home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 02 - 1986 / 02.12 Dec 86.sit / 02.12 Dec 86 / MacApp Dots game / Sources (Text) / UDots.inc1.p < prev    next >
MacBinary  |  1986-10-20  |  22.8 KB  |  [TEXT/MACA]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Oct 20 11:22:09 1986, modified Mon Oct 20 11:22:09 1986, creator MacWrite, type ASCII, 22705 bytes "UDots.inc1.p" , at 0x5931 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MACA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 55 44 6f 74 73 2e | 69 6e 63 31 2e 70 00 00 |..UDots.|inc1.p..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 41 43 | 41 01 00 00 00 00 00 00 |.TEXTMAC|A.......|
|00000050| 00 00 00 00 00 58 b1 00 | 00 01 7e 9b bf fc a1 9b |.....X..|..~.....|
|00000060| bf fc a1 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f3 9a 00 00 |........|........|
|00000080| 43 4f 4e 53 54 0d 0d 6b | 54 79 70 65 43 72 65 61 |CONST..k|TypeCrea|
|00000090| 74 6f 72 20 3d 20 27 64 | 6f 74 73 27 3b 09 7b 20 |tor = 'd|ots';.{ |
|000000a0| 6d 79 20 64 6f 63 75 6d | 65 6e 74 20 74 79 70 65 |my docum|ent type|
|000000b0| 20 61 6e 64 20 63 72 65 | 61 74 6f 72 20 7d 0d 09 | and cre|ator }..|
|000000c0| 0d 6b 57 49 4e 44 69 64 | 20 3d 20 31 32 38 3b 09 |.kWINDid| = 128;.|
|000000d0| 09 7b 20 72 73 72 63 20 | 49 44 20 6f 66 20 6d 79 |.{ rsrc |ID of my|
|000000e0| 20 57 49 4e 44 20 72 65 | 73 6f 75 72 63 65 20 7d | WIND re|source }|
|000000f0| 0d 09 0d 6b 4c 61 73 74 | 4d 6f 76 65 43 6f 6d 6d |...kLast|MoveComm|
|00000100| 61 6e 64 20 3d 20 32 30 | 30 31 3b 09 09 0d 09 7b |and = 20|01;....{|
|00000110| 20 63 6f 6d 6d 61 6e 64 | 20 6e 75 6d 62 65 72 20 | command| number |
|00000120| 66 6f 72 20 74 68 65 20 | 4d 6f 76 65 20 63 6f 6d |for the |Move com|
|00000130| 6d 61 6e 64 3b 20 69 6e | 20 4d 61 63 41 70 70 20 |mand; in| MacApp |
|00000140| 09 65 76 65 72 79 20 6d | 65 6e 75 20 69 74 65 6d |.every m|enu item|
|00000150| 20 69 73 20 61 73 73 69 | 67 6e 65 64 20 61 6e 20 | is assi|gned an |
|00000160| 49 4e 54 45 47 45 52 20 | 63 6f 6d 6d 61 6e 64 20 |INTEGER |command |
|00000170| 09 6e 75 6d 62 65 72 2c | 20 77 68 69 63 68 20 6d |.number,| which m|
|00000180| 61 6b 65 73 20 69 74 20 | 65 61 73 69 65 72 20 74 |akes it |easier t|
|00000190| 6f 20 64 65 61 6c 20 77 | 69 74 68 20 63 6f 6d 6d |o deal w|ith comm|
|000001a0| 61 6e 64 73 20 7d 0d 09 | 0d 6b 50 6c 61 79 65 72 |ands }..|.kPlayer|
|000001b0| 31 20 3d 20 54 52 55 45 | 3b 09 09 7b 20 69 6e 64 |1 = TRUE|;..{ ind|
|000001c0| 69 63 65 73 20 66 6f 72 | 20 67 50 6c 61 79 65 72 |ices for| gPlayer|
|000001d0| 50 61 74 73 20 7d 0d 6b | 50 6c 61 79 65 72 32 20 |Pats }.k|Player2 |
|000001e0| 3d 20 46 41 4c 53 45 3b | 0d 09 0d 6b 53 74 61 67 |= FALSE;|...kStag|
|000001f0| 67 65 72 41 6d 6f 75 6e | 74 20 3d 20 31 30 3b 09 |gerAmoun|t = 10;.|
|00000200| 7b 20 61 6d 6f 75 6e 74 | 20 74 6f 20 6f 66 66 73 |{ amount| to offs|
|00000210| 65 74 20 65 61 63 68 20 | 77 69 6e 64 6f 77 20 62 |et each |window b|
|00000220| 79 20 7d 0d 0d 6b 48 61 | 6c 66 44 6f 74 53 69 7a |y }..kHa|lfDotSiz|
|00000230| 65 09 3d 09 33 3b 09 09 | 7b 20 68 61 6c 66 20 74 |e.=.3;..|{ half t|
|00000240| 68 65 20 77 69 64 74 68 | 20 6f 66 20 61 20 64 6f |he width| of a do|
|00000250| 74 20 7d 0d 6b 46 75 6c | 6c 44 6f 74 53 69 7a 65 |t }.kFul|lDotSize|
|00000260| 09 3d 09 32 2a 6b 48 61 | 6c 66 44 6f 74 53 69 7a |.=.2*kHa|lfDotSiz|
|00000270| 65 20 2b 20 31 3b 0d 09 | 0d 6b 48 61 6c 66 4c 69 |e + 1;..|.kHalfLi|
|00000280| 6e 65 53 69 7a 65 09 3d | 09 31 3b 09 09 7b 20 68 |neSize.=|.1;..{ h|
|00000290| 61 6c 66 20 77 69 64 74 | 68 20 6f 66 20 6f 63 63 |alf widt|h of occ|
|000002a0| 75 70 69 65 64 20 6c 69 | 6e 65 20 7d 0d 6b 46 75 |upied li|ne }.kFu|
|000002b0| 6c 6c 4c 69 6e 65 53 69 | 7a 65 09 3d 09 32 2a 6b |llLineSi|ze.=.2*k|
|000002c0| 48 61 6c 66 4c 69 6e 65 | 53 69 7a 65 20 2b 20 31 |HalfLine|Size + 1|
|000002d0| 3b 0d 6b 4c 69 6e 65 4f | 66 66 73 65 74 09 3d 09 |;.kLineO|ffset.=.|
|000002e0| 28 6b 46 75 6c 6c 44 6f | 74 53 69 7a 65 20 2d 20 |(kFullDo|tSize - |
|000002f0| 6b 46 75 6c 6c 4c 69 6e | 65 53 69 7a 65 29 20 44 |kFullLin|eSize) D|
|00000300| 49 56 20 32 3b 0d 09 0d | 6b 44 6f 74 53 70 61 63 |IV 2;...|kDotSpac|
|00000310| 69 6e 67 09 09 3d 09 34 | 2a 6b 46 75 6c 6c 44 6f |ing..=.4|*kFullDo|
|00000320| 74 53 69 7a 65 3b 09 09 | 0d 09 7b 20 73 70 61 63 |tSize;..|..{ spac|
|00000330| 69 6e 67 20 62 65 74 77 | 65 65 6e 20 63 65 6e 74 |ing betw|een cent|
|00000340| 65 72 73 20 6f 66 20 64 | 6f 74 73 20 7d 0d 6b 48 |ers of d|ots }.kH|
|00000350| 61 6c 66 53 70 61 63 69 | 6e 67 09 3d 09 6b 44 6f |alfSpaci|ng.=.kDo|
|00000360| 74 53 70 61 63 69 6e 67 | 20 44 49 56 20 32 3b 0d |tSpacing| DIV 2;.|
|00000370| 09 0d 6b 53 63 6f 72 65 | 53 70 61 63 69 6e 67 09 |..kScore|Spacing.|
|00000380| 3d 09 33 2a 6b 44 6f 74 | 53 70 61 63 69 6e 67 3b |=.3*kDot|Spacing;|
|00000390| 0d 6b 53 63 6f 72 65 49 | 6e 73 65 74 09 09 3d 09 |.kScoreI|nset..=.|
|000003a0| 36 3b 0d 09 0d 09 0d 56 | 41 52 0d 09 0d 67 53 74 |6;.....V|AR...gSt|
|000003b0| 61 67 67 65 72 43 6f 75 | 6e 74 3a 09 49 4e 54 45 |aggerCou|nt:.INTE|
|000003c0| 47 45 52 3b 09 7b 20 75 | 73 65 64 20 74 6f 20 73 |GER;.{ u|sed to s|
|000003d0| 74 61 67 67 65 72 20 77 | 69 6e 64 6f 77 73 20 7d |tagger w|indows }|
|000003e0| 0d 67 50 6c 61 79 65 72 | 50 61 74 73 3a 09 41 52 |.gPlayer|Pats:.AR|
|000003f0| 52 41 59 5b 42 4f 4f 4c | 45 41 4e 5d 20 4f 46 20 |RAY[BOOL|EAN] OF |
|00000400| 50 61 74 74 65 72 6e 3b | 0d 09 09 09 7b 20 74 68 |Pattern;|....{ th|
|00000410| 65 20 70 61 74 74 65 72 | 6e 73 20 72 65 70 72 65 |e patter|ns repre|
|00000420| 73 65 6e 74 69 6e 67 20 | 74 68 65 20 20 74 77 6f |senting |the two|
|00000430| 20 70 6c 61 79 65 72 73 | 20 7d 0d 0d 7b 24 53 20 | players| }..{$S |
|00000440| 44 6f 74 73 7d 09 7b 20 | 65 76 65 72 79 74 68 69 |Dots}.{ |everythi|
|00000450| 6e 67 20 69 6e 20 31 20 | 73 65 67 6d 65 6e 74 20 |ng in 1 |segment |
|00000460| 7d 0d 0d 0d 7b 20 48 65 | 72 65 20 61 72 65 20 61 |}...{ He|re are a|
|00000470| 6c 6c 20 74 68 65 20 6d | 65 74 68 6f 64 20 69 6d |ll the m|ethod im|
|00000480| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 73 2e 20 20 |plementa|tions. |
|00000490| 49 20 68 61 76 65 20 6f | 72 64 65 72 65 64 20 0d |I have o|rdered .|
|000004a0| 74 68 65 73 65 20 74 6f | 20 6d 61 6b 65 20 69 74 |these to| make it|
|000004b0| 20 65 61 73 69 65 72 20 | 74 6f 20 72 65 61 64 20 | easier |to read |
|000004c0| 74 68 6f 75 67 68 20 74 | 68 65 20 63 6f 64 65 2e |though t|he code.|
|000004d0| 20 7d 0d 09 0d 0d 7b 20 | 54 68 65 20 66 69 72 73 | }....{ |The firs|
|000004e0| 74 20 74 68 69 6e 67 20 | 74 68 61 74 20 68 61 70 |t thing |that hap|
|000004f0| 70 65 6e 73 20 69 6e 20 | 74 68 65 20 6d 61 69 6e |pens in |the main|
|00000500| 20 70 72 6f 67 72 61 6d | 20 69 73 20 74 6f 20 69 | program| is to i|
|00000510| 6e 69 74 69 61 6c 69 7a | 65 20 20 0d 74 68 65 20 |nitializ|e .the |
|00000520| 54 6f 6f 6c 62 6f 78 20 | 61 6e 64 20 63 72 65 61 |Toolbox |and crea|
|00000530| 74 65 20 26 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |te & ini|tialize |
|00000540| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00000550| 6f 62 6a 65 63 74 2e 20 | 20 54 68 69 73 20 0d 6d |object. | This .m|
|00000560| 65 74 68 6f 64 20 6a 75 | 73 74 20 73 65 74 73 20 |ethod ju|st sets |
|00000570| 75 70 20 74 68 65 20 67 | 6c 6f 62 61 6c 20 76 61 |up the g|lobal va|
|00000580| 72 69 61 62 6c 65 73 20 | 61 62 6f 76 65 2e 20 7d |riables |above. }|
|00000590| 0d 09 0d 50 52 4f 43 45 | 44 55 52 45 20 54 44 6f |...PROCE|DURE TDo|
|000005a0| 74 41 70 70 6c 69 63 61 | 74 69 6f 6e 2e 49 44 6f |tApplica|tion.IDo|
|000005b0| 74 41 70 70 6c 69 63 61 | 74 69 6f 6e 3b 0d 42 45 |tApplica|tion;.BE|
|000005c0| 47 49 4e 0d 7b 20 53 70 | 65 63 69 66 79 20 74 68 |GIN.{ Sp|ecify th|
|000005d0| 65 20 6d 61 69 6e 20 66 | 69 6c 65 20 74 79 70 65 |e main f|ile type|
|000005e0| 20 6f 66 20 6d 79 20 64 | 6f 63 75 6d 65 6e 74 73 | of my d|ocuments|
|000005f0| 20 7d 0d 09 49 41 70 70 | 6c 69 63 61 74 69 6f 6e | }..IApp|lication|
|00000600| 28 6b 54 79 70 65 43 72 | 65 61 74 6f 72 29 3b 0d |(kTypeCr|eator);.|
|00000610| 09 67 53 74 61 67 67 65 | 72 43 6f 75 6e 74 20 3a |.gStagge|rCount :|
|00000620| 3d 20 30 3b 0d 09 67 50 | 6c 61 79 65 72 50 61 74 |= 0;..gP|layerPat|
|00000630| 73 5b 6b 50 6c 61 79 65 | 72 31 5d 20 3a 3d 20 6c |s[kPlaye|r1] := l|
|00000640| 74 47 72 61 79 3b 0d 09 | 67 50 6c 61 79 65 72 50 |tGray;..|gPlayerP|
|00000650| 61 74 73 5b 6b 50 6c 61 | 79 65 72 32 5d 20 3a 3d |ats[kPla|yer2] :=|
|00000660| 20 64 6b 47 72 61 79 3b | 0d 45 4e 44 3b 0d 09 0d | dkGray;|.END;...|
|00000670| 0d 7b 20 4e 65 78 74 2c | 20 74 68 65 20 61 70 70 |.{ Next,| the app|
|00000680| 6c 69 63 61 74 69 6f 6e | 20 69 73 20 74 6f 6c 64 |lication| is told|
|00000690| 20 74 6f 20 63 72 65 61 | 74 65 20 61 20 64 6f 63 | to crea|te a doc|
|000006a0| 75 6d 65 6e 74 20 6f 62 | 6a 65 63 74 2c 20 0d 65 |ument ob|ject, .e|
|000006b0| 69 74 68 65 72 20 6f 6e | 65 20 74 68 61 74 20 77 |ither on|e that w|
|000006c0| 69 6c 6c 20 62 65 20 62 | 6c 61 6e 6b 20 6f 72 20 |ill be b|lank or |
|000006d0| 6f 6e 65 20 74 68 61 74 | 20 77 69 6c 6c 20 62 65 |one that| will be|
|000006e0| 20 72 65 61 64 20 66 72 | 6f 6d 20 64 69 73 6b 2e | read fr|om disk.|
|000006f0| 20 20 0d 49 6e 20 74 68 | 69 73 20 70 72 6f 67 72 | .In th|is progr|
|00000700| 61 6d 20 49 20 68 61 76 | 65 20 6f 6e 6c 79 20 6f |am I hav|e only o|
|00000710| 6e 65 20 6b 69 6e 64 20 | 6f 66 20 64 6f 63 75 6d |ne kind |of docum|
|00000720| 65 6e 74 2c 20 73 6f 20 | 49 20 69 67 6e 6f 72 65 |ent, so |I ignore|
|00000730| 20 0d 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 2e | .the pa|rameter.|
|00000740| 20 20 4d 61 63 41 70 70 | 20 64 6f 65 73 20 73 75 | MacApp| does su|
|00000750| 70 70 6f 72 74 20 20 6d | 75 6c 74 69 70 6c 65 20 |pport m|ultiple |
|00000760| 64 6f 63 75 6d 65 6e 74 | 20 0d 6b 69 6e 64 73 20 |document| .kinds |
|00000770| 69 6e 20 74 68 65 20 73 | 61 6d 65 20 61 70 70 6c |in the s|ame appl|
|00000780| 69 63 61 74 69 6f 6e 2c | 20 68 6f 77 65 76 65 72 |ication,| however|
|00000790| 2e 20 7d 0d 09 0d 46 55 | 4e 43 54 49 4f 4e 20 20 |. }...FU|NCTION |
|000007a0| 54 44 6f 74 41 70 70 6c | 69 63 61 74 69 6f 6e 2e |TDotAppl|ication.|
|000007b0| 44 6f 4d 61 6b 65 44 6f | 63 75 6d 65 6e 74 28 0d |DoMakeDo|cument(.|
|000007c0| 09 69 74 73 43 6d 64 4e | 75 6d 62 65 72 3a 20 43 |.itsCmdN|umber: C|
|000007d0| 6d 64 4e 75 6d 62 65 72 | 29 3a 20 54 44 6f 63 75 |mdNumber|): TDocu|
|000007e0| 6d 65 6e 74 3b 20 4f 56 | 45 52 52 49 44 45 3b 0d |ment; OV|ERRIDE;.|
|000007f0| 0d 09 56 41 52 09 64 6f | 74 44 6f 63 3a 09 54 44 |..VAR.do|tDoc:.TD|
|00000800| 6f 74 44 6f 63 75 6d 65 | 6e 74 3b 0d 42 45 47 49 |otDocume|nt;.BEGI|
|00000810| 4e 0d 7b 20 54 68 69 73 | 20 69 73 20 68 6f 77 20 |N.{ This| is how |
|00000820| 79 6f 75 20 63 72 65 61 | 74 65 20 61 6e 20 6f 62 |you crea|te an ob|
|00000830| 6a 65 63 74 2e 20 7d 0d | 09 4e 65 77 28 64 6f 74 |ject. }.|.New(dot|
|00000840| 44 6f 63 29 3b 0d 09 09 | 0d 7b 20 54 68 69 73 20 |Doc);...|.{ This |
|00000850| 73 69 67 6e 61 6c 73 20 | 61 20 66 61 69 6c 75 72 |signals |a failur|
|00000860| 65 20 69 66 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |e if the| object |
|00000870| 69 73 20 4e 49 4c 3b 20 | 69 2e 65 2e 2c 20 69 66 |is NIL; |i.e., if|
|00000880| 20 77 65 20 72 61 6e 20 | 6f 75 74 20 6f 66 20 0d | we ran |out of .|
|00000890| 6d 65 6d 6f 72 79 2e 20 | 20 4d 61 63 41 70 70 20 |memory. | MacApp |
|000008a0| 77 69 6c 6c 20 63 61 74 | 63 68 20 74 68 65 20 66 |will cat|ch the f|
|000008b0| 61 69 6c 75 72 65 20 61 | 6e 64 20 64 69 73 70 6c |ailure a|nd displ|
|000008c0| 61 79 20 61 6e 20 0d 61 | 70 70 72 6f 70 72 69 61 |ay an .a|ppropria|
|000008d0| 74 65 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |te error| message|
|000008e0| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 2e 20 | automat|ically. |
|000008f0| 7d 0d 09 46 61 69 6c 4e | 69 6c 28 64 6f 74 44 6f |}..FailN|il(dotDo|
|00000900| 63 29 3b 0d 09 64 6f 74 | 44 6f 63 2e 49 44 6f 74 |c);..dot|Doc.IDot|
|00000910| 44 6f 63 75 6d 65 6e 74 | 3b 0d 09 44 6f 4d 61 6b |Document|;..DoMak|
|00000920| 65 44 6f 63 75 6d 65 6e | 74 20 3a 3d 20 64 6f 74 |eDocumen|t := dot|
|00000930| 44 6f 63 3b 0d 45 4e 44 | 3b 0d 09 0d 0d 7b 20 54 |Doc;.END|;....{ T|
|00000940| 68 69 73 20 69 6e 69 74 | 69 61 6c 69 7a 65 73 20 |his init|ializes |
|00000950| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 6f 62 6a |the docu|ment obj|
|00000960| 65 63 74 2e 20 20 49 20 | 68 61 76 65 20 74 68 69 |ect. I |have thi|
|00000970| 73 20 6d 65 74 68 6f 64 | 20 6f 6e 6c 79 20 0d 66 |s method| only .f|
|00000980| 6f 72 20 63 6f 6e 73 69 | 73 74 65 6e 63 79 20 77 |or consi|stency w|
|00000990| 69 74 68 20 6f 74 68 65 | 72 20 6f 62 6a 65 63 74 |ith othe|r object|
|000009a0| 20 74 79 70 65 73 2e 20 | 20 49 20 63 6f 75 6c 64 | types. | I could|
|000009b0| 20 68 61 76 65 20 63 61 | 6c 6c 65 64 20 0d 49 44 | have ca|lled .ID|
|000009c0| 6f 63 75 6d 65 6e 74 20 | 20 64 69 72 65 63 74 6c |ocument | directl|
|000009d0| 79 20 69 6e 20 74 68 65 | 20 6d 65 74 68 6f 64 20 |y in the| method |
|000009e0| 61 62 6f 76 65 2e 20 20 | 54 68 65 20 70 61 72 61 |above. |The para|
|000009f0| 6d 65 74 65 72 73 20 74 | 6f 20 0d 49 44 6f 63 75 |meters t|o .IDocu|
|00000a00| 6d 65 6e 74 20 73 70 65 | 63 69 66 79 20 74 68 65 |ment spe|cify the|
|00000a10| 20 64 6f 63 75 6d 65 6e | 74 20 74 79 70 65 20 61 | documen|t type a|
|00000a20| 6e 64 20 63 72 65 61 74 | 6f 72 2c 20 20 77 68 65 |nd creat|or, whe|
|00000a30| 74 68 65 72 20 0d 74 68 | 65 20 64 6f 63 75 6d 65 |ther .th|e docume|
|00000a40| 6e 74 20 75 73 65 73 20 | 74 68 65 20 64 61 74 61 |nt uses |the data|
|00000a50| 20 61 6e 64 2f 6f 72 20 | 72 65 73 6f 75 72 63 65 | and/or |resource|
|00000a60| 20 66 6f 72 6b 20 6f 66 | 20 74 68 65 20 66 69 6c | fork of| the fil|
|00000a70| 65 2c 0d 61 6e 64 20 77 | 68 65 74 68 65 72 20 74 |e,.and w|hether t|
|00000a80| 6f 20 6c 65 61 76 65 20 | 74 68 65 20 64 61 74 61 |o leave |the data|
|00000a90| 20 61 6e 64 2f 6f 72 20 | 72 65 73 6f 75 72 63 65 | and/or |resource|
|00000aa0| 20 66 6f 72 6b 28 73 29 | 20 6f 70 65 6e 20 28 74 | fork(s)| open (t|
|00000ab0| 6f 20 0d 69 6d 70 6c 65 | 6d 65 6e 74 20 64 69 73 |o .imple|ment dis|
|00000ac0| 6b 2d 62 61 73 65 64 20 | 64 6f 63 75 6d 65 6e 74 |k-based |document|
|00000ad0| 73 29 2e 20 7d 0d 09 0d | 50 52 4f 43 45 44 55 52 |s). }...|PROCEDUR|
|00000ae0| 45 20 54 44 6f 74 44 6f | 63 75 6d 65 6e 74 2e 49 |E TDotDo|cument.I|
|00000af0| 44 6f 74 44 6f 63 75 6d | 65 6e 74 3b 0d 42 45 47 |DotDocum|ent;.BEG|
|00000b00| 49 4e 0d 09 49 44 6f 63 | 75 6d 65 6e 74 28 6b 54 |IN..IDoc|ument(kT|
|00000b10| 79 70 65 43 72 65 61 74 | 6f 72 2c 20 6b 54 79 70 |ypeCreat|or, kTyp|
|00000b20| 65 43 72 65 61 74 6f 72 | 2c 09 0d 09 09 09 09 6b |eCreator|,......k|
|00000b30| 55 73 65 73 44 61 74 61 | 46 6f 72 6b 2c 20 4e 4f |UsesData|Fork, NO|
|00000b40| 54 20 6b 55 73 65 73 52 | 73 72 63 46 6f 72 6b 2c |T kUsesR|srcFork,|
|00000b50| 0d 09 09 09 09 4e 4f 54 | 20 6b 44 61 74 61 4f 70 |.....NOT| kDataOp|
|00000b60| 65 6e 2c 20 4e 4f 54 20 | 6b 52 73 72 63 4f 70 65 |en, NOT |kRsrcOpe|
|00000b70| 6e 29 3b 0d 45 4e 44 3b | 0d 09 0d 0d 7b 20 4f 6e |n);.END;|....{ On|
|00000b80| 63 65 20 77 65 20 68 61 | 76 65 20 61 6e 20 69 6e |ce we ha|ve an in|
|00000b90| 69 74 69 61 6c 69 7a 65 | 64 20 64 6f 63 75 6d 65 |itialize|d docume|
|00000ba0| 6e 74 20 4d 61 63 41 70 | 70 20 65 69 74 68 65 72 |nt MacAp|p either|
|00000bb0| 20 63 61 6c 6c 73 20 0d | 44 6f 49 6e 69 74 69 61 | calls .|DoInitia|
|00000bc0| 6c 53 74 61 74 65 20 74 | 6f 20 73 65 74 20 69 74 |lState t|o set it|
|00000bd0| 20 75 70 20 61 73 20 61 | 20 62 6c 61 6e 6b 20 64 | up as a| blank d|
|00000be0| 6f 63 75 6d 65 6e 74 2c | 20 6f 72 20 44 6f 52 65 |ocument,| or DoRe|
|00000bf0| 61 64 20 74 6f 20 0d 72 | 65 61 64 20 69 74 20 66 |ad to .r|ead it f|
|00000c00| 72 6f 6d 20 74 68 65 20 | 64 69 73 6b 2e 20 20 54 |rom the |disk. T|
|00000c10| 68 65 73 65 20 6d 65 74 | 68 6f 64 73 20 61 72 65 |hese met|hods are|
|00000c20| 20 61 6c 73 6f 20 63 61 | 6c 6c 65 64 20 69 6e 20 | also ca|lled in |
|00000c30| 0d 72 65 73 70 6f 6e 73 | 65 20 74 6f 20 61 20 52 |.respons|e to a R|
|00000c40| 65 76 65 72 74 20 63 6f | 6d 6d 61 6e 64 2e 20 7d |evert co|mmand. }|
|00000c50| 0d 09 0d 50 52 4f 43 45 | 44 55 52 45 20 54 44 6f |...PROCE|DURE TDo|
|00000c60| 74 44 6f 63 75 6d 65 6e | 74 2e 44 6f 49 6e 69 74 |tDocumen|t.DoInit|
|00000c70| 69 61 6c 53 74 61 74 65 | 3b 20 4f 56 45 52 52 49 |ialState|; OVERRI|
|00000c80| 44 45 3b 0d 0d 09 56 41 | 52 09 64 69 72 65 63 74 |DE;...VA|R.direct|
|00000c90| 69 6f 6e 3a 09 4c 69 6e | 65 44 69 72 3b 0d 09 09 |ion:.Lin|eDir;...|
|00000ca0| 72 6f 77 3a 09 09 49 4e | 54 45 47 45 52 3b 0d 09 |row:..IN|TEGER;..|
|00000cb0| 09 63 6f 6c 3a 09 09 49 | 4e 54 45 47 45 52 3b 0d |.col:..I|NTEGER;.|
|00000cc0| 42 45 47 49 4e 0d 7b 20 | 45 72 61 73 65 20 61 6c |BEGIN.{ |Erase al|
|00000cd0| 6c 20 74 68 65 20 6c 69 | 6e 65 73 20 69 6e 20 74 |l the li|nes in t|
|00000ce0| 68 65 20 67 72 69 64 20 | 2c 20 61 6e 64 20 63 6c |he grid |, and cl|
|00000cf0| 65 61 72 20 74 68 65 20 | 62 6f 78 65 73 7d 0d 09 |ear the |boxes}..|
|00000d00| 46 4f 52 20 72 6f 77 20 | 3a 3d 20 31 20 54 4f 20 |FOR row |:= 1 TO |
|00000d10| 6b 44 6f 74 73 50 65 72 | 52 6f 77 20 44 4f 0d 09 |kDotsPer|Row DO..|
|00000d20| 09 46 4f 52 20 63 6f 6c | 20 3a 3d 20 31 20 54 4f |.FOR col| := 1 TO|
|00000d30| 20 6b 44 6f 74 73 50 65 | 72 52 6f 77 20 44 4f 20 | kDotsPe|rRow DO |
|00000d40| 20 42 45 47 49 4e 0d 09 | 09 09 46 4f 52 20 64 69 | BEGIN..|..FOR di|
|00000d50| 72 65 63 74 69 6f 6e 20 | 3a 3d 20 68 4c 69 6e 65 |rection |:= hLine|
|00000d60| 20 54 4f 20 76 4c 69 6e | 65 20 44 4f 0d 09 09 09 | TO vLin|e DO....|
|00000d70| 09 66 4c 69 6e 65 73 5b | 64 69 72 65 63 74 69 6f |.fLines[|directio|
|00000d80| 6e 2c 20 72 6f 77 2c 20 | 63 6f 6c 5d 20 3a 3d 20 |n, row, |col] := |
|00000d90| 46 41 4c 53 45 3b 0d 09 | 09 09 66 42 6f 78 65 73 |FALSE;..|..fBoxes|
|00000da0| 5b 72 6f 77 2c 20 63 6f | 6c 5d 20 3a 3d 20 6b 42 |[row, co|l] := kB|
|00000db0| 6f 78 46 72 65 65 3b 0d | 09 09 45 4e 44 3b 0d 09 |oxFree;.|..END;..|
|00000dc0| 09 09 0d 7b 20 48 61 76 | 65 20 70 6c 61 79 65 72 |...{ Hav|e player|
|00000dd0| 20 31 20 67 6f 20 66 69 | 72 73 74 20 7d 0d 09 66 | 1 go fi|rst }..f|
|00000de0| 50 6c 61 79 65 72 31 54 | 75 72 6e 20 3a 3d 20 54 |Player1T|urn := T|
|00000df0| 52 55 45 3b 0d 45 4e 44 | 3b 0d 09 0d 0d 7b 20 57 |RUE;.END|;....{ W|
|00000e00| 68 65 6e 20 74 68 69 73 | 20 6d 65 74 68 6f 64 20 |hen this| method |
|00000e10| 69 73 20 63 61 6c 6c 65 | 64 2c 20 4d 61 63 41 70 |is calle|d, MacAp|
|00000e20| 70 20 68 61 73 20 61 6c | 72 65 61 64 79 20 6f 70 |p has al|ready op|
|00000e30| 65 6e 65 64 20 74 68 65 | 20 0d 66 69 6c 65 20 66 |ened the| .file f|
|00000e40| 6f 72 20 75 73 2e 20 66 | 6f 72 50 72 69 6e 74 69 |or us. f|orPrinti|
|00000e50| 6e 67 20 69 73 20 54 52 | 55 45 20 69 66 20 74 68 |ng is TR|UE if th|
|00000e60| 65 20 75 73 65 72 20 63 | 68 6f 73 65 20 50 72 69 |e user c|hose Pri|
|00000e70| 6e 74 20 66 72 6f 6d 20 | 74 68 65 20 0d 46 69 6e |nt from |the .Fin|
|00000e80| 64 65 72 3b 20 69 6e 20 | 73 6f 6d 65 20 63 61 73 |der; in |some cas|
|00000e90| 65 73 20 79 6f 75 20 63 | 61 6e 20 6f 70 74 69 6d |es you c|an optim|
|00000ea0| 69 7a 65 20 79 6f 75 72 | 20 72 65 61 64 69 6e 67 |ize your| reading|
|00000eb0| 20 69 66 20 79 6f 75 20 | 0d 6b 6e 6f 77 20 74 68 | if you |.know th|
|00000ec0| 61 74 20 79 6f 75 20 61 | 72 65 20 6f 6e 6c 79 20 |at you a|re only |
|00000ed0| 70 72 69 6e 74 69 6e 67 | 2e 20 7d 0d 09 0d 50 52 |printing|. }...PR|
|00000ee0| 4f 43 45 44 55 52 45 20 | 54 44 6f 74 44 6f 63 75 |OCEDURE |TDotDocu|
|00000ef0| 6d 65 6e 74 2e 44 6f 52 | 65 61 64 28 61 52 65 66 |ment.DoR|ead(aRef|
|00000f00| 6e 75 6d 3a 20 49 4e 54 | 45 47 45 52 3b 20 0d 09 |num: INT|EGER; ..|
|00000f10| 09 72 73 72 63 45 78 69 | 73 74 73 2c 20 66 6f 72 |.rsrcExi|sts, for|
|00000f20| 50 72 69 6e 74 69 6e 67 | 3a 20 42 4f 4f 4c 45 41 |Printing|: BOOLEA|
|00000f30| 4e 29 3b 20 4f 56 45 52 | 52 49 44 45 3b 0d 0d 09 |N); OVER|RIDE;...|
|00000f40| 56 41 52 20 63 6f 75 6e | 74 3a 09 4c 4f 4e 47 49 |VAR coun|t:.LONGI|
|00000f50| 4e 54 3b 0d 09 09 78 3a | 09 09 49 4e 54 45 47 45 |NT;...x:|..INTEGE|
|00000f60| 52 3b 0d 42 45 47 49 4e | 0d 7b 20 54 68 69 73 20 |R;.BEGIN|.{ This |
|00000f70| 72 65 61 64 73 20 74 68 | 65 20 70 72 69 6e 74 20 |reads th|e print |
|00000f80| 73 74 61 74 65 20 73 61 | 76 65 64 20 69 6e 20 74 |state sa|ved in t|
|00000f90| 68 65 20 66 69 6c 65 20 | 7d 0d 09 49 4e 48 45 52 |he file |}..INHER|
|00000fa0| 49 54 45 44 20 44 6f 52 | 65 61 64 28 61 52 65 66 |ITED DoR|ead(aRef|
|00000fb0| 6e 75 6d 2c 20 72 73 72 | 63 45 78 69 73 74 73 2c |num, rsr|cExists,|
|00000fc0| 20 66 6f 72 50 72 69 6e | 74 69 6e 67 29 3b 0d 0d | forPrin|ting);..|
|00000fd0| 7b 20 52 65 61 64 20 77 | 68 6f 73 65 20 74 75 72 |{ Read w|hose tur|
|00000fe0| 6e 20 69 74 20 69 73 2e | 20 7d 0d 09 63 6f 75 6e |n it is.| }..coun|
|00000ff0| 74 20 3a 3d 20 32 3b 0d | 09 46 61 69 6c 4f 53 45 |t := 2;.|.FailOSE|
|00001000| 72 72 28 46 53 52 65 61 | 64 28 61 52 65 66 6e 75 |rr(FSRea|d(aRefnu|
|00001010| 6d 2c 20 63 6f 75 6e 74 | 2c 20 40 78 29 29 3b 0d |m, count|, @x));.|
|00001020| 09 49 46 20 78 20 3d 20 | 31 20 0d 09 54 48 45 4e |.IF x = |1 ..THEN|
|00001030| 09 66 50 6c 61 79 65 72 | 31 54 75 72 6e 20 3a 3d |.fPlayer|1Turn :=|
|00001040| 20 54 52 55 45 0d 09 45 | 4c 53 45 09 66 50 6c 61 | TRUE..E|LSE.fPla|
|00001050| 79 65 72 31 54 75 72 6e | 20 3a 3d 20 46 41 4c 53 |yer1Turn| := FALS|
|00001060| 45 3b 0d 0d 7b 20 52 65 | 61 64 20 74 68 65 20 6c |E;..{ Re|ad the l|
|00001070| 69 6e 65 20 73 74 61 74 | 65 73 20 7d 0d 09 63 6f |ine stat|es }..co|
|00001080| 75 6e 74 20 3a 3d 20 53 | 49 5a 45 4f 46 28 4c 69 |unt := S|IZEOF(Li|
|00001090| 6e 65 41 72 72 61 79 29 | 3b 0d 09 46 61 69 6c 4f |neArray)|;..FailO|
|000010a0| 53 45 72 72 28 46 53 52 | 65 61 64 28 61 52 65 66 |SErr(FSR|ead(aRef|
|000010b0| 6e 75 6d 2c 20 63 6f 75 | 6e 74 2c 20 40 66 4c 69 |num, cou|nt, @fLi|
|000010c0| 6e 65 73 29 29 3b 0d 0d | 7b 20 61 6e 64 20 62 6f |nes));..|{ and bo|
|000010d0| 78 20 73 74 61 74 65 73 | 2e 20 7d 0d 09 63 6f 75 |x states|. }..cou|
|000010e0| 6e 74 20 3a 3d 20 53 49 | 5a 45 4f 46 28 42 6f 78 |nt := SI|ZEOF(Box|
|000010f0| 41 72 72 61 79 29 3b 0d | 09 46 61 69 6c 4f 53 45 |Array);.|.FailOSE|
|00001100| 72 72 28 46 53 52 65 61 | 64 28 61 52 65 66 6e 75 |rr(FSRea|d(aRefnu|
|00001110| 6d 2c 20 63 6f 75 6e 74 | 2c 20 40 66 42 6f 78 65 |m, count|, @fBoxe|
|00001120| 73 29 29 3b 0d 45 4e 44 | 3b 0d 09 0d 0d 7b 20 4e |s));.END|;....{ N|
|00001130| 6f 77 20 77 65 20 68 61 | 76 65 20 74 68 65 20 64 |ow we ha|ve the d|
|00001140| 6f 63 75 6d 65 6e 74 20 | 72 65 61 64 20 69 6e 2c |ocument |read in,|
|00001150| 20 73 6f 20 77 65 20 6d | 61 6b 65 20 76 69 65 77 | so we m|ake view|
|00001160| 73 20 74 68 61 74 20 0d | 64 69 73 70 6c 61 79 20 |s that .|display |
|00001170| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 6f 6e 20 |the docu|ment on |
|00001180| 74 68 65 20 73 63 72 65 | 65 6e 2e 20 20 53 69 6e |the scre|en. Sin|
|00001190| 63 65 20 77 65 20 64 6f | 6e 27 74 20 70 72 69 6e |ce we do|n't prin|
|000011a0| 74 20 74 68 65 20 0d 73 | 63 6f 72 65 2c 20 77 65 |t the .s|core, we|
|000011b0| 20 64 6f 6e 27 74 20 6e | 65 65 64 20 61 20 73 63 | don't n|eed a sc|
|000011c0| 6f 72 65 20 76 69 65 77 | 20 69 66 20 77 65 20 61 |ore view| if we a|
|000011d0| 72 65 20 6a 75 73 74 20 | 70 72 69 6e 74 69 6e 67 |re just |printing|
|000011e0| 2e 20 7d 0d 09 0d 50 52 | 4f 43 45 44 55 52 45 20 |. }...PR|OCEDURE |
|000011f0| 54 44 6f 74 44 6f 63 75 | 6d 65 6e 74 2e 44 6f 4d |TDotDocu|ment.DoM|
|00001200| 61 6b 65 56 69 65 77 73 | 28 0d 09 09 09 09 66 6f |akeViews|(.....fo|
|00001210| 72 50 72 69 6e 74 69 6e | 67 3a 20 42 4f 4f 4c 45 |rPrintin|g: BOOLE|
|00001220| 41 4e 29 3b 20 4f 56 45 | 52 52 49 44 45 3b 0d 0d |AN); OVE|RRIDE;..|
|00001230| 09 56 41 52 09 64 6f 74 | 56 69 65 77 3a 09 54 44 |.VAR.dot|View:.TD|
|00001240| 6f 74 56 69 65 77 3b 0d | 09 09 73 63 6f 72 65 56 |otView;.|..scoreV|
|00001250| 69 65 77 3a 09 54 53 63 | 6f 72 65 56 69 65 77 3b |iew:.TSc|oreView;|
|00001260| 0d 42 45 47 49 4e 0d 09 | 4e 65 77 28 64 6f 74 56 |.BEGIN..|New(dotV|
|00001270| 69 65 77 29 3b 0d 09 46 | 61 69 6c 4e 49 4c 28 64 |iew);..F|ailNIL(d|
|00001280| 6f 74 56 69 65 77 29 3b | 0d 09 64 6f 74 56 69 65 |otView);|..dotVie|
|00001290| 77 2e 49 44 6f 74 56 69 | 65 77 28 53 45 4c 46 29 |w.IDotVi|ew(SELF)|
|000012a0| 3b 0d 09 66 44 6f 74 56 | 69 65 77 20 3a 3d 20 64 |;..fDotV|iew := d|
|000012b0| 6f 74 56 69 65 77 3b 0d | 0d 09 49 46 20 66 6f 72 |otView;.|..IF for|
|000012c0| 50 72 69 6e 74 69 6e 67 | 20 0d 09 54 48 45 4e 09 |Printing| ..THEN.|
|000012d0| 66 53 63 6f 72 65 56 69 | 65 77 20 3a 3d 20 4e 49 |fScoreVi|ew := NI|
|000012e0| 4c 0d 09 45 4c 53 45 20 | 42 45 47 49 4e 0d 09 09 |L..ELSE |BEGIN...|
|000012f0| 4e 65 77 28 73 63 6f 72 | 65 56 69 65 77 29 3b 0d |New(scor|eView);.|
|00001300| 09 09 46 61 69 6c 4e 49 | 4c 28 73 63 6f 72 65 56 |..FailNI|L(scoreV|
|00001310| 69 65 77 29 3b 0d 09 09 | 73 63 6f 72 65 56 69 65 |iew);...|scoreVie|
|00001320| 77 2e 49 53 63 6f 72 65 | 56 69 65 77 28 53 45 4c |w.IScore|View(SEL|
|00001330| 46 29 3b 0d 09 09 66 53 | 63 6f 72 65 56 69 65 77 |F);...fS|coreView|
|00001340| 20 3a 3d 20 73 63 6f 72 | 65 56 69 65 77 3b 0d 09 | := scor|eView;..|
|00001350| 45 4e 44 3b 0d 45 4e 44 | 3b 0d 09 0d 0d 7b 20 48 |END;.END|;....{ H|
|00001360| 65 72 65 20 61 72 65 20 | 74 68 65 20 6d 65 74 68 |ere are |the meth|
|00001370| 6f 64 73 20 66 6f 72 20 | 69 6e 69 74 69 61 6c 69 |ods for |initiali|
|00001380| 7a 69 6e 67 20 74 68 65 | 20 76 69 65 77 73 2e 20 |zing the| views. |
|00001390| 7d 0d 0d 50 52 4f 43 45 | 44 55 52 45 20 54 44 6f |}..PROCE|DURE TDo|
|000013a0| 74 56 69 65 77 2e 49 44 | 6f 74 56 69 65 77 28 0d |tView.ID|otView(.|
|000013b0| 09 09 09 09 09 69 74 73 | 44 6f 63 75 6d 65 6e 74 |.....its|Document|
|000013c0| 3a 20 54 44 6f 74 44 6f | 63 75 6d 65 6e 74 29 3b |: TDotDo|cument);|
|000013d0| 0d 0d 09 56 41 52 09 73 | 69 64 65 3a 09 09 49 4e |...VAR.s|ide:..IN|
|000013e0| 54 45 47 45 52 3b 0d 09 | 09 65 78 74 65 6e 74 3a |TEGER;..|.extent:|
|000013f0| 09 09 52 65 63 74 3b 0d | 09 09 61 48 61 6e 64 6c |..Rect;.|..aHandl|
|00001400| 65 72 3a 09 54 53 74 64 | 50 72 69 6e 74 48 61 6e |er:.TStd|PrintHan|
|00001410| 64 6c 65 72 3b 0d 42 45 | 47 49 4e 0d 09 73 69 64 |dler;.BE|GIN..sid|
|00001420| 65 20 3a 3d 20 28 6b 44 | 6f 74 73 50 65 72 52 6f |e := (kD|otsPerRo|
|00001430| 77 2b 31 29 2a 6b 44 6f | 74 53 70 61 63 69 6e 67 |w+1)*kDo|tSpacing|
|00001440| 3b 0d 09 53 65 74 52 65 | 63 74 28 65 78 74 65 6e |;..SetRe|ct(exten|
|00001450| 74 2c 20 30 2c 20 30 2c | 20 73 69 64 65 2c 20 73 |t, 0, 0,| side, s|
|00001460| 69 64 65 29 3b 0d 0d 09 | 66 44 6f 74 44 6f 63 75 |ide);...|fDotDocu|
|00001470| 6d 65 6e 74 20 3a 3d 20 | 69 74 73 44 6f 63 75 6d |ment := |itsDocum|
|00001480| 65 6e 74 3b 0d 09 09 0d | 7b 20 73 69 7a 65 46 69 |ent;....|{ sizeFi|
|00001490| 78 65 64 20 74 65 6c 6c | 73 20 4d 61 63 41 70 70 |xed tell|s MacApp|
|000014a0| 20 74 68 61 74 20 74 68 | 65 20 76 69 65 77 20 63 | that th|e view c|
|000014b0| 68 61 6e 67 65 73 20 73 | 69 7a 65 20 6f 6e 6c 79 |hanges s|ize only|
|000014c0| 20 77 68 65 6e 20 0d 79 | 6f 75 20 73 65 74 20 69 | when .y|ou set i|
|000014d0| 74 3b 20 79 6f 75 20 63 | 61 6e 20 61 6c 73 6f 20 |t; you c|an also |
|000014e0| 68 61 76 65 20 4d 61 63 | 41 70 70 20 61 75 74 6f |have Mac|App auto|
|000014f0| 6d 61 74 69 63 61 6c 6c | 79 20 6d 61 6b 65 20 74 |maticall|y make t|
|00001500| 68 65 20 20 0d 76 69 65 | 77 20 61 6e 20 69 6e 74 |he .vie|w an int|
|00001510| 65 67 72 61 6c 20 6e 75 | 6d 62 65 72 20 6f 66 20 |egral nu|mber of |
|00001520| 70 61 67 65 73 2c 20 6f | 72 20 65 78 61 63 74 6c |pages, o|r exactl|
|00001530| 79 20 31 20 70 61 67 65 | 2e 20 7d 0d 09 49 56 69 |y 1 page|. }..IVi|
|00001540| 65 77 28 4e 49 4c 2c 20 | 69 74 73 44 6f 63 75 6d |ew(NIL, |itsDocum|
|00001550| 65 6e 74 2c 20 65 78 74 | 65 6e 74 2c 20 0d 09 09 |ent, ext|ent, ...|
|00001560| 09 09 09 73 69 7a 65 46 | 69 78 65 64 2c 20 73 69 |...sizeF|ixed, si|
|00001570| 7a 65 46 69 78 65 64 2c | 20 54 52 55 45 2c 20 68 |zeFixed,| TRUE, h|
|00001580| 6c 4f 66 66 29 3b 0d 09 | 09 0d 7b 20 63 72 65 61 |lOff);..|..{ crea|
|00001590| 74 69 6e 67 20 61 20 54 | 53 74 64 50 72 69 6e 74 |ting a T|StdPrint|
|000015a0| 48 61 6e 64 6c 65 72 20 | 69 73 20 61 6c 6c 20 79 |Handler |is all y|
|000015b0| 6f 75 20 6e 65 65 64 20 | 74 6f 20 64 6f 20 74 6f |ou need |to do to|
|000015c0| 20 6d 61 6b 65 20 61 20 | 0d 76 69 65 77 20 70 72 | make a |.view pr|
|000015d0| 69 6e 74 61 62 6c 65 2e | 20 7d 0d 09 4e 65 77 28 |intable.| }..New(|
|000015e0| 61 48 61 6e 64 6c 65 72 | 29 3b 0d 09 46 61 69 6c |aHandler|);..Fail|
|000015f0| 4e 49 4c 28 61 48 61 6e | 64 6c 65 72 29 3b 0d 09 |NIL(aHan|dler);..|
|00001600| 61 48 61 6e 64 6c 65 72 | 2e 49 53 74 64 50 72 69 |aHandler|.IStdPri|
|00001610| 6e 74 48 61 6e 64 6c 65 | 72 28 53 45 4c 46 2c 20 |ntHandle|r(SELF, |
|00001620| 46 41 4c 53 45 29 3b 0d | 45 4e 44 3b 0d 09 0d 09 |FALSE);.|END;....|
|00001630| 0d 50 52 4f 43 45 44 55 | 52 45 20 54 53 63 6f 72 |.PROCEDU|RE TScor|
|00001640| 65 56 69 65 77 2e 49 53 | 63 6f 72 65 56 69 65 77 |eView.IS|coreView|
|00001650| 28 0d 09 09 09 09 09 69 | 74 73 44 6f 63 75 6d 65 |(......i|tsDocume|
|00001660| 6e 74 3a 20 54 44 6f 74 | 44 6f 63 75 6d 65 6e 74 |nt: TDot|Document|
|00001670| 29 3b 0d 42 45 47 49 4e | 0d 09 66 44 6f 74 44 6f |);.BEGIN|..fDotDo|
|00001680| 63 75 6d 65 6e 74 20 3a | 3d 20 69 74 73 44 6f 63 |cument :|= itsDoc|
|00001690| 75 6d 65 6e 74 3b 0d 09 | 66 50 6c 61 79 65 72 31 |ument;..|fPlayer1|
|000016a0| 54 75 72 6e 20 3a 3d 20 | 69 74 73 44 6f 63 75 6d |Turn := |itsDocum|
|000016b0| 65 6e 74 2e 66 50 6c 61 | 79 65 72 31 54 75 72 6e |ent.fPla|yer1Turn|
|000016c0| 3b 0d 09 09 0d 09 49 56 | 69 65 77 28 4e 49 4c 2c |;.....IV|iew(NIL,|
|000016d0| 20 69 74 73 44 6f 63 75 | 6d 65 6e 74 2c 20 67 5a | itsDocu|ment, gZ|
|000016e0| 65 72 6f 52 65 63 74 2c | 20 73 69 7a 65 46 72 61 |eroRect,| sizeFra|
|000016f0| 6d 65 2c 20 09 09 09 09 | 09 09 73 69 7a 65 46 72 |me, ....|..sizeFr|
|00001700| 61 6d 65 2c 20 54 52 55 | 45 2c 20 68 6c 4f 66 66 |ame, TRU|E, hlOff|
|00001710| 29 3b 0d 45 4e 44 3b 0d | 09 0d 09 0d 7b 20 49 66 |);.END;.|....{ If|
|00001720| 20 77 65 20 61 72 65 6e | 27 74 20 70 72 69 6e 74 | we aren|'t print|
|00001730| 69 6e 67 2c 20 74 68 65 | 6e 20 4d 61 63 41 70 70 |ing, the|n MacApp|
|00001740| 20 63 61 6c 6c 73 20 74 | 68 69 73 20 74 6f 20 63 | calls t|his to c|
|00001750| 72 65 61 74 65 20 6f 6e | 65 20 6f 72 20 0d 6d 6f |reate on|e or .mo|
|00001760| 72 65 20 77 69 6e 64 6f | 77 20 74 6f 20 64 69 73 |re windo|w to dis|
|00001770| 70 6c 61 79 20 74 68 65 | 20 76 69 65 77 73 2e 20 |play the| views. |
|00001780| 7d 0d 0d 50 52 4f 43 45 | 44 55 52 45 20 54 44 6f |}..PROCE|DURE TDo|
|00001790| 74 44 6f 63 75 6d 65 6e | 74 2e 44 6f 4d 61 6b 65 |tDocumen|t.DoMake|
|000017a0| 57 69 6e 64 6f 77 73 3b | 20 4f 56 45 52 52 49 44 |Windows;| OVERRID|
|000017b0| 45 3b 0d 0d 09 56 41 52 | 09 61 57 69 6e 64 6f 77 |E;...VAR|.aWindow|
|000017c0| 3a 09 54 57 69 6e 64 6f | 77 3b 0d 42 45 47 49 4e |:.TWindo|w;.BEGIN|
|000017d0| 0d 7b 20 4e 65 77 50 61 | 6c 65 74 74 65 57 69 6e |.{ NewPa|letteWin|
|000017e0| 64 6f 77 20 69 73 20 61 | 20 75 74 69 6c 69 74 79 |dow is a| utility|
|000017f0| 20 70 72 6f 76 69 64 65 | 64 20 62 79 20 4d 61 63 | provide|d by Mac|
|00001800| 41 70 70 20 74 68 61 74 | 20 0d 63 72 65 61 74 65 |App that| .create|
|00001810| 73 20 61 20 77 69 6e 64 | 6f 77 20 63 6f 6e 74 61 |s a wind|ow conta|
|00001820| 69 6e 69 6e 67 20 32 20 | 76 69 65 77 73 2e 20 20 |ining 2 |views. |
|00001830| 4f 6e 65 20 69 73 20 61 | 20 6d 61 69 6e 20 76 69 |One is a| main vi|
|00001840| 65 77 20 74 68 61 74 20 | 0d 63 61 6e 20 73 63 72 |ew that |.can scr|
|00001850| 6f 6c 6c 20 61 6e 64 20 | 74 68 65 20 6f 74 68 65 |oll and |the othe|
|00001860| 72 20 69 73 20 61 20 70 | 61 6c 65 74 74 65 2f 73 |r is a p|alette/s|
|00001870| 74 61 74 75 73 20 76 69 | 65 77 20 74 68 61 74 20 |tatus vi|ew that |
|00001880| 64 6f 65 73 20 6e 6f 74 | 20 0d 73 63 72 6f 6c 6c |does not| .scroll|
|00001890| 2e 20 20 54 68 65 72 65 | 20 69 73 20 61 6c 73 6f |. There| is also|
|000018a0| 20 61 20 72 6f 75 74 69 | 6e 65 20 63 61 6c 6c 65 | a routi|ne calle|
|000018b0| 64 20 4e 65 77 53 69 6d | 70 6c 65 57 69 6e 64 6f |d NewSim|pleWindo|
|000018c0| 77 20 74 68 61 74 20 0d | 63 72 65 61 74 65 73 20 |w that .|creates |
|000018d0| 61 20 77 69 6e 64 6f 77 | 20 77 69 74 68 20 6f 6e |a window| with on|
|000018e0| 6c 79 20 31 20 73 63 72 | 6f 6c 6c 61 62 6c 65 20 |ly 1 scr|ollable |
|000018f0| 76 69 65 77 2e 20 7d 0d | 09 09 09 09 0d 09 61 57 |view. }.|......aW|
|00001900| 69 6e 64 6f 77 20 3a 3d | 20 4e 65 77 50 61 6c 65 |indow :=| NewPale|
|00001910| 74 74 65 57 69 6e 64 6f | 77 28 6b 57 49 4e 44 69 |tteWindo|w(kWINDi|
|00001920| 64 2c 20 0d 09 09 4e 4f | 54 20 6b 44 69 61 6c 6f |d, ...NO|T kDialo|
|00001930| 67 57 69 6e 64 6f 77 2c | 20 6b 57 61 6e 74 48 53 |gWindow,| kWantHS|
|00001940| 63 72 6f 6c 6c 42 61 72 | 2c 20 09 09 6b 57 61 6e |crollBar|, ..kWan|
|00001950| 74 56 53 63 72 6f 6c 6c | 42 61 72 2c 20 66 44 6f |tVScroll|Bar, fDo|
|00001960| 74 56 69 65 77 2c 20 66 | 53 63 6f 72 65 56 69 65 |tView, f|ScoreVie|
|00001970| 77 2c 20 09 09 6b 44 6f | 74 53 70 61 63 69 6e 67 |w, ..kDo|tSpacing|
|00001980| 2b 6b 48 61 6c 66 53 70 | 61 63 69 6e 67 2c 20 6b |+kHalfSp|acing, k|
|00001990| 54 6f 70 50 61 6c 65 74 | 74 65 29 3b 0d 09 09 09 |TopPalet|te);....|
|000019a0| 09 09 09 0d 7b 20 54 68 | 69 73 20 69 73 20 61 6e |....{ Th|is is an|
|000019b0| 6f 74 68 65 72 20 75 74 | 69 6c 69 74 79 20 74 68 |other ut|ility th|
|000019c0| 61 74 20 73 74 61 67 67 | 65 72 73 20 77 69 6e 64 |at stagg|ers wind|
|000019d0| 6f 77 73 20 6f 6e 20 74 | 68 65 20 73 63 72 65 65 |ows on t|he scree|
|000019e0| 6e 2e 20 7d 0d 09 53 69 | 6d 70 6c 65 53 74 61 67 |n. }..Si|mpleStag|
|000019f0| 67 65 72 28 61 57 69 6e | 64 6f 77 2c 20 6b 53 74 |ger(aWin|dow, kSt|
|00001a00| 61 67 67 65 72 41 6d 6f | 75 6e 74 2c 20 09 09 09 |aggerAmo|unt, ...|
|00001a10| 09 09 09 6b 53 74 61 67 | 67 65 72 41 6d 6f 75 6e |...kStag|gerAmoun|
|00001a20| 74 2c 20 67 53 74 61 67 | 67 65 72 43 6f 75 6e 74 |t, gStag|gerCount|
|00001a30| 29 3b 0d 45 4e 44 3b 0d | 0d 0d 7b 20 54 68 65 20 |);.END;.|..{ The |
|00001a40| 66 69 72 73 74 20 65 76 | 65 6e 74 20 74 68 65 20 |first ev|ent the |
|00001a50| 77 65 20 77 69 6c 6c 20 | 72 65 63 65 69 76 65 20 |we will |receive |
|00001a60| 69 73 20 6f 6e 65 20 74 | 6f 20 75 70 64 61 74 65 |is one t|o update|
|00001a70| 20 74 68 65 20 0d 77 69 | 6e 64 6f 77 73 2e 20 20 | the .wi|ndows. |
|00001a80| 54 68 69 73 20 72 65 73 | 75 6c 74 73 20 69 6e 20 |This res|ults in |
|00001a90| 63 61 6c 6c 69 6e 67 20 | 74 68 65 20 44 72 61 77 |calling |the Draw|
|00001aa0| 20 6d 65 74 68 6f 64 73 | 20 6f 66 20 74 68 65 20 | methods| of the |
|00001ab0| 32 20 0d 76 69 65 77 73 | 2e 20 7d 0d 0d 7b 20 54 |2 .views|. }..{ T|
|00001ac0| 68 69 73 20 6d 65 74 68 | 6f 64 20 64 72 61 77 73 |his meth|od draws|
|00001ad0| 20 74 68 65 20 67 72 69 | 64 2e 20 20 49 66 20 77 | the gri|d. If w|
|00001ae0| 65 20 77 61 6e 74 65 64 | 20 74 6f 20 6f 70 74 69 |e wanted| to opti|
|00001af0| 6d 69 7a 65 20 69 74 2c | 20 77 65 20 0d 63 6f 75 |mize it,| we .cou|
|00001b00| 6c 64 20 65 78 61 6d 69 | 6e 65 20 74 68 65 20 20 |ld exami|ne the |
|00001b10| 61 72 65 61 20 70 61 72 | 61 6d 65 74 65 72 20 61 |area par|ameter a|
|00001b20| 6e 64 20 64 65 74 65 72 | 6d 69 6e 65 20 74 68 65 |nd deter|mine the|
|00001b30| 20 6d 69 6e 69 6d 75 6d | 20 0d 6e 75 6d 62 65 72 | minimum| .number|
|00001b40| 20 6f 66 20 72 6f 77 73 | 20 61 6e 64 20 63 6f 6c | of rows| and col|
|00001b50| 75 6d 6e 73 20 74 68 61 | 74 20 6e 65 65 64 20 74 |umns tha|t need t|
|00001b60| 6f 20 62 65 20 64 72 61 | 77 6e 2e 20 7d 0d 09 0d |o be dra|wn. }...|
|00001b70| 50 52 4f 43 45 44 55 52 | 45 20 54 44 6f 74 56 69 |PROCEDUR|E TDotVi|
|00001b80| 65 77 2e 44 72 61 77 28 | 61 72 65 61 3a 20 52 65 |ew.Draw(|area: Re|
|00001b90| 63 74 29 3b 20 4f 56 45 | 52 52 49 44 45 3b 0d 0d |ct); OVE|RRIDE;..|
|00001ba0| 09 56 41 52 09 72 6f 77 | 2c 20 63 6f 6c 3a 09 09 |.VAR.row|, col:..|
|00001bb0| 49 4e 54 45 47 45 52 3b | 0d 42 45 47 49 4e 0d 09 |INTEGER;|.BEGIN..|
|00001bc0| 46 4f 52 20 72 6f 77 20 | 3a 3d 20 31 20 54 4f 20 |FOR row |:= 1 TO |
|00001bd0| 6b 44 6f 74 73 50 65 72 | 52 6f 77 20 44 4f 0d 09 |kDotsPer|Row DO..|
|00001be0| 09 46 4f 52 20 63 6f 6c | 20 3a 3d 20 31 20 54 4f |.FOR col| := 1 TO|
|00001bf0| 20 6b 44 6f 74 73 50 65 | 72 52 6f 77 20 44 4f 0d | kDotsPe|rRow DO.|
|00001c00| 09 09 09 44 72 61 77 43 | 6f 72 6e 65 72 28 72 6f |...DrawC|orner(ro|
|00001c10| 77 2c 20 63 6f 6c 29 3b | 0d 45 4e 44 3b 0d 09 0d |w, col);|.END;...|
|00001c20| 0d 7b 20 54 68 69 73 20 | 64 6f 65 73 20 61 6c 6c |.{ This |does all|
|00001c30| 20 74 68 65 20 77 6f 72 | 6b 2e 20 7d 0d 0d 50 52 | the wor|k. }..PR|
|00001c40| 4f 43 45 44 55 52 45 20 | 54 44 6f 74 56 69 65 77 |OCEDURE |TDotView|
|00001c50| 2e 44 72 61 77 43 6f 72 | 6e 65 72 28 72 6f 77 2c |.DrawCor|ner(row,|
|00001c60| 20 63 6f 6c 3a 20 49 4e | 54 45 47 45 52 29 3b 0d | col: IN|TEGER);.|
|00001c70| 0d 09 56 41 52 09 72 3a | 09 09 09 52 65 63 74 3b |..VAR.r:|...Rect;|
|00001c80| 0d 09 09 62 6f 78 53 74 | 61 74 65 3a 09 42 6f 78 |...boxSt|ate:.Box|
|00001c90| 53 74 61 74 65 3b 0d 09 | 09 6c 69 6e 65 53 74 61 |State;..|.lineSta|
|00001ca0| 74 65 3a 09 09 42 4f 4f | 4c 45 41 4e 3b 0d 42 45 |te:..BOO|LEAN;.BE|
|00001cb0| 47 49 4e 0d 09 49 46 20 | 28 72 6f 77 20 3c 20 6b |GIN..IF |(row < k|
|00001cc0| 44 6f 74 73 50 65 72 52 | 6f 77 29 20 41 4e 44 20 |DotsPerR|ow) AND |
|00001cd0| 0d 09 09 09 09 09 28 63 | 6f 6c 20 3c 20 6b 44 6f |......(c|ol < kDo|
|00001ce0| 74 73 50 65 72 52 6f 77 | 29 20 0d 09 54 48 45 4e |tsPerRow|) ..THEN|
|00001cf0| 20 20 42 45 47 49 4e 0d | 09 09 50 65 6e 4e 6f 72 | BEGIN.|..PenNor|
|00001d00| 6d 61 6c 3b 0d 09 09 09 | 0d 09 09 42 6f 78 32 52 |mal;....|...Box2R|
|00001d10| 65 63 74 28 72 6f 77 2c | 20 63 6f 6c 2c 20 72 29 |ect(row,| col, r)|
|00001d20| 3b 0d 0d 09 7b 20 46 69 | 72 73 74 20 64 72 61 77 |;...{ Fi|rst draw|
|00001d30| 20 74 68 65 20 62 6f 78 | 20 69 66 20 69 74 20 6e | the box| if it n|
|00001d40| 65 65 64 73 20 74 6f 20 | 62 65 20 73 68 61 64 65 |eeds to |be shade|
|00001d50| 64 20 69 6e 2e 20 7d 0d | 09 09 62 6f 78 53 74 61 |d in. }.|..boxSta|
|00001d60| 74 65 20 3a 3d 20 66 44 | 6f 74 44 6f 63 75 6d 65 |te := fD|otDocume|
|00001d70| 6e 74 2e 47 65 74 42 6f | 78 53 74 61 74 65 28 72 |nt.GetBo|xState(r|
|00001d80| 6f 77 2c 20 63 6f 6c 29 | 3b 0d 09 09 49 46 20 62 |ow, col)|;...IF b|
|00001d90| 6f 78 53 74 61 74 65 20 | 3d 20 6b 42 6f 78 50 6c |oxState |= kBoxPl|
|00001da0| 61 79 65 72 31 20 0d 09 | 09 54 48 45 4e 20 20 42 |ayer1 ..|.THEN B|
|00001db0| 45 47 49 4e 0d 09 09 09 | 46 69 6c 6c 52 65 63 74 |EGIN....|FillRect|
|00001dc0| 28 72 2c 20 67 50 6c 61 | 79 65 72 50 61 74 73 5b |(r, gPla|yerPats[|
|00001dd0| 6b 50 6c 61 79 65 72 31 | 5d 29 3b 0d 09 09 09 46 |kPlayer1|]);....F|
|00001de0| 72 61 6d 65 52 65 63 74 | 28 72 29 3b 0d 09 09 45 |rameRect|(r);...E|
|00001df0| 4e 44 0d 09 09 45 4c 53 | 45 20 49 46 20 62 6f 78 |ND...ELS|E IF box|
|00001e00| 53 74 61 74 65 20 3d 20 | 6b 42 6f 78 50 6c 61 79 |State = |kBoxPlay|
|00001e10| 65 72 32 20 0d 09 09 54 | 48 45 4e 20 20 42 45 47 |er2 ...T|HEN BEG|
|00001e20| 49 4e 0d 09 09 09 46 69 | 6c 6c 52 65 63 74 28 72 |IN....Fi|llRect(r|
|00001e30| 2c 20 67 50 6c 61 79 65 | 72 50 61 74 73 5b 6b 50 |, gPlaye|rPats[kP|
|00001e40| 6c 61 79 65 72 32 5d 29 | 3b 0d 09 09 09 46 72 61 |layer2])|;....Fra|
|00001e50| 6d 65 52 65 63 74 28 72 | 29 3b 0d 09 09 45 4e 44 |meRect(r|);...END|
|00001e60| 3b 0d 09 45 4e 44 3b 0d | 09 09 09 0d 09 44 6f 74 |;..END;.|.....Dot|
|00001e70| 32 52 65 63 74 28 72 6f | 77 2c 20 63 6f 6c 2c 20 |2Rect(ro|w, col, |
|00001e80| 72 29 3b 0d 09 09 0d 09 | 50 65 6e 4e 6f 72 6d 61 |r);.....|PenNorma|
|00001e90| 6c 3b 0d 09 50 65 6e 53 | 69 7a 65 28 6b 46 75 6c |l;..PenS|ize(kFul|
|00001ea0| 6c 4c 69 6e 65 53 69 7a | 65 2c 20 6b 46 75 6c 6c |lLineSiz|e, kFull|
|00001eb0| 4c 69 6e 65 53 69 7a 65 | 29 3b 0d 0d 7b 20 54 68 |LineSize|);..{ Th|
|00001ec0| 65 6e 20 64 72 61 77 20 | 74 68 65 20 6c 69 6e 65 |en draw |the line|
|00001ed0| 20 64 6f 77 6e 20 66 72 | 6f 6d 20 74 68 65 20 64 | down fr|om the d|
|00001ee0| 6f 74 20 28 69 66 20 61 | 6e 79 29 20 7d 0d 09 49 |ot (if a|ny) }..I|
|00001ef0| 46 20 28 72 6f 77 20 3c | 20 6b 44 6f 74 73 50 65 |F (row <| kDotsPe|
|00001f00| 72 52 6f 77 29 20 41 4e | 44 20 0d 09 09 09 66 44 |rRow) AN|D ....fD|
|00001f10| 6f 74 44 6f 63 75 6d 65 | 6e 74 2e 47 65 74 4c 69 |otDocume|nt.GetLi|
|00001f20| 6e 65 53 74 61 74 65 28 | 76 4c 69 6e 65 2c 20 72 |neState(|vLine, r|
|00001f30| 6f 77 2c 20 63 6f 6c 29 | 20 0d 09 54 48 45 4e 20 |ow, col)| ..THEN |
|00001f40| 42 45 47 49 4e 0d 09 09 | 4d 6f 76 65 54 6f 28 72 |BEGIN...|MoveTo(r|
|00001f50| 2e 6c 65 66 74 2b 6b 4c | 69 6e 65 4f 66 66 73 65 |.left+kL|ineOffse|
|00001f60| 74 2c 20 72 2e 74 6f 70 | 2b 6b 4c 69 6e 65 4f 66 |t, r.top|+kLineOf|
|00001f70| 66 73 65 74 29 3b 0d 09 | 09 4c 69 6e 65 28 30 2c |fset);..|.Line(0,|
|00001f80| 20 6b 44 6f 74 53 70 61 | 63 69 6e 67 29 3b 0d 09 | kDotSpa|cing);..|
|00001f90| 45 4e 44 3b 0d 09 09 0d | 7b 20 41 6e 64 20 74 68 |END;....|{ And th|
|00001fa0| 65 20 6c 69 6e 65 20 74 | 6f 20 69 74 73 20 72 69 |e line t|o its ri|
|00001fb0| 67 68 74 20 28 69 66 20 | 61 6e 79 29 20 7d 0d 09 |ght (if |any) }..|
|00001fc0| 49 46 20 28 63 6f 6c 20 | 3c 20 6b 44 6f 74 73 50 |IF (col |< kDotsP|
|00001fd0| 65 72 52 6f 77 29 20 41 | 4e 44 0d 09 09 09 66 44 |erRow) A|ND....fD|
|00001fe0| 6f 74 44 6f 63 75 6d 65 | 6e 74 2e 47 65 74 4c 69 |otDocume|nt.GetLi|
|00001ff0| 6e 65 53 74 61 74 65 28 | 68 4c 69 6e 65 2c 20 72 |neState(|hLine, r|
|00002000| 6f 77 2c 20 63 6f 6c 29 | 20 0d 09 54 48 45 4e 20 |ow, col)| ..THEN |
|00002010| 42 45 47 49 4e 0d 09 09 | 4d 6f 76 65 54 6f 28 72 |BEGIN...|MoveTo(r|
|00002020| 2e 6c 65 66 74 2b 6b 4c | 69 6e 65 4f 66 66 73 65 |.left+kL|ineOffse|
|00002030| 74 2c 20 72 2e 74 6f 70 | 2b 6b 4c 69 6e 65 4f 66 |t, r.top|+kLineOf|
|00002040| 66 73 65 74 29 3b 0d 09 | 09 4c 69 6e 65 28 6b 44 |fset);..|.Line(kD|
|00002050| 6f 74 53 70 61 63 69 6e | 67 2c 20 30 29 3b 0d 09 |otSpacin|g, 0);..|
|00002060| 45 4e 44 3b 0d 0d 7b 20 | 46 69 6e 61 6c 6c 79 20 |END;..{ |Finally |
|00002070| 64 72 61 77 20 74 68 65 | 20 64 6f 74 20 69 74 73 |draw the| dot its|
|00002080| 65 6c 66 20 7d 0d 09 46 | 69 6c 6c 4f 76 61 6c 28 |elf }..F|illOval(|
|00002090| 72 2c 20 62 6c 61 63 6b | 29 3b 0d 45 4e 44 3b 0d |r, black|);.END;.|
|000020a0| 09 0d 0d 7b 20 55 74 69 | 6c 69 74 69 65 73 20 75 |...{ Uti|lities u|
|000020b0| 73 65 64 20 69 6e 20 64 | 72 61 77 69 6e 67 20 74 |sed in d|rawing t|
|000020c0| 68 65 20 67 72 69 64 2e | 7d 0d 0d 7b 20 54 68 69 |he grid.|}..{ Thi|
|000020d0| 73 20 67 65 74 73 20 74 | 68 65 20 73 74 61 74 65 |s gets t|he state|
|000020e0| 20 6f 66 20 61 20 62 6f | 78 2e 20 7d 0d 46 55 4e | of a bo|x. }.FUN|
|000020f0| 43 54 49 4f 4e 20 20 54 | 44 6f 74 44 6f 63 75 6d |CTION T|DotDocum|
|00002100| 65 6e 74 2e 47 65 74 42 | 6f 78 53 74 61 74 65 28 |ent.GetB|oxState(|
|00002110| 0d 09 09 09 09 09 09 72 | 6f 77 2c 20 63 6f 6c 3a |.......r|ow, col:|
|00002120| 20 49 4e 54 45 47 45 52 | 29 3a 20 42 6f 78 53 74 | INTEGER|): BoxSt|
|00002130| 61 74 65 3b 0d 42 45 47 | 49 4e 0d 09 47 65 74 42 |ate;.BEG|IN..GetB|
|00002140| 6f 78 53 74 61 74 65 20 | 3a 3d 20 66 42 6f 78 65 |oxState |:= fBoxe|
|00002150| 73 5b 72 6f 77 2c 20 63 | 6f 6c 5d 3b 0d 45 4e 44 |s[row, c|ol];.END|
|00002160| 3b 0d 0d 0d 7b 20 54 68 | 69 73 20 67 65 74 73 20 |;...{ Th|is gets |
|00002170| 74 68 65 20 73 74 61 74 | 65 20 6f 66 20 61 20 6c |the stat|e of a l|
|00002180| 69 6e 65 2e 20 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 |ine. }.F|UNCTION |
|00002190| 20 54 44 6f 74 44 6f 63 | 75 6d 65 6e 74 2e 47 65 | TDotDoc|ument.Ge|
|000021a0| 74 4c 69 6e 65 53 74 61 | 74 65 28 64 69 72 65 63 |tLineSta|te(direc|
|000021b0| 74 69 6f 6e 3a 20 4c 69 | 6e 65 44 69 72 3b 0d 09 |tion: Li|neDir;..|
|000021c0| 09 09 09 09 09 72 6f 77 | 2c 20 63 6f 6c 3a 20 49 |.....row|, col: I|
|000021d0| 4e 54 45 47 45 52 29 3a | 20 42 4f 4f 4c 45 41 4e |NTEGER):| BOOLEAN|
|000021e0| 3b 0d 42 45 47 49 4e 0d | 09 47 65 74 4c 69 6e 65 |;.BEGIN.|.GetLine|
|000021f0| 53 74 61 74 65 20 3a 3d | 20 66 4c 69 6e 65 73 5b |State :=| fLines[|
|00002200| 64 69 72 65 63 74 69 6f | 6e 2c 20 72 6f 77 2c 20 |directio|n, row, |
|00002210| 63 6f 6c 5d 3b 0d 45 4e | 44 3b 0d 09 0d 0d 7b 20 |col];.EN|D;....{ |
|00002220| 54 68 69 73 20 67 65 74 | 73 20 74 68 65 20 72 65 |This get|s the re|
|00002230| 63 74 61 6e 67 6c 65 20 | 64 65 66 69 6e 69 6e 67 |ctangle |defining|
|00002240| 20 61 20 62 6f 78 2e 20 | 7d 0d 0d 50 52 4f 43 45 | a box. |}..PROCE|
|00002250| 44 55 52 45 20 54 44 6f | 74 56 69 65 77 2e 42 6f |DURE TDo|tView.Bo|
|00002260| 78 32 52 65 63 74 28 72 | 6f 77 2c 20 63 6f 6c 3a |x2Rect(r|ow, col:|
|00002270| 20 49 4e 54 45 47 45 52 | 3b 20 0d 09 09 09 09 09 | INTEGER|; ......|
|00002280| 09 09 09 09 56 41 52 20 | 72 3a 20 52 65 63 74 29 |....VAR |r: Rect)|
|00002290| 3b 0d 09 56 41 52 09 63 | 65 6e 74 65 72 3a 09 50 |;..VAR.c|enter:.P|
|000022a0| 6f 69 6e 74 3b 0d 42 45 | 47 49 4e 0d 09 44 6f 74 |oint;.BE|GIN..Dot|
|000022b0| 43 65 6e 74 65 72 28 72 | 6f 77 2c 20 63 6f 6c 2c |Center(r|ow, col,|
|000022c0| 20 63 65 6e 74 65 72 29 | 3b 0d 09 09 0d 09 53 65 | center)|;.....Se|
|000022d0| 74 52 65 63 74 28 72 2c | 20 30 2c 20 30 2c 20 6b |tRect(r,| 0, 0, k|
|000022e0| 44 6f 74 53 70 61 63 69 | 6e 67 2b 31 2c 20 6b 44 |DotSpaci|ng+1, kD|
|000022f0| 6f 74 53 70 61 63 69 6e | 67 2b 31 29 3b 0d 09 4f |otSpacin|g+1);..O|
|00002300| 66 66 73 65 74 52 65 63 | 74 28 72 2c 20 63 65 6e |ffsetRec|t(r, cen|
|00002310| 74 65 72 2e 68 2c 20 63 | 65 6e 74 65 72 2e 76 29 |ter.h, c|enter.v)|
|00002320| 3b 0d 09 49 6e 73 65 74 | 52 65 63 74 28 72 2c 20 |;..Inset|Rect(r, |
|00002330| 6b 48 61 6c 66 4c 69 6e | 65 53 69 7a 65 2b 34 2c |kHalfLin|eSize+4,|
|00002340| 20 6b 48 61 6c 66 4c 69 | 6e 65 53 69 7a 65 2b 34 | kHalfLi|neSize+4|
|00002350| 29 3b 0d 45 4e 44 3b 0d | 09 0d 0d 7b 20 54 68 69 |);.END;.|...{ Thi|
|00002360| 73 20 72 65 74 75 72 6e | 73 20 74 68 65 20 72 65 |s return|s the re|
|00002370| 63 74 61 6e 67 6c 65 20 | 74 68 61 74 20 64 65 66 |ctangle |that def|
|00002380| 69 6e 65 73 20 61 20 70 | 61 72 74 69 63 75 6c 61 |ines a p|articula|
|00002390| 72 20 64 6f 74 2e 20 7d | 0d 0d 50 52 4f 43 45 44 |r dot. }|..PROCED|
|000023a0| 55 52 45 20 54 44 6f 74 | 56 69 65 77 2e 44 6f 74 |URE TDot|View.Dot|
|000023b0| 32 52 65 63 74 28 72 6f | 77 2c 20 63 6f 6c 3a 20 |2Rect(ro|w, col: |
|000023c0| 49 4e 54 45 47 45 52 3b | 20 0d 09 09 09 09 09 09 |INTEGER;| .......|
|000023d0| 09 09 09 56 41 52 20 72 | 3a 20 52 65 63 74 29 3b |...VAR r|: Rect);|
|000023e0| 0d 09 56 41 52 09 63 65 | 6e 74 65 72 3a 09 50 6f |..VAR.ce|nter:.Po|
|000023f0| 69 6e 74 3b 0d 42 45 47 | 49 4e 0d 09 44 6f 74 43 |int;.BEG|IN..DotC|
|00002400| 65 6e 74 65 72 28 72 6f | 77 2c 20 63 6f 6c 2c 20 |enter(ro|w, col, |
|00002410| 63 65 6e 74 65 72 29 3b | 0d 09 53 65 74 52 65 63 |center);|..SetRec|
|00002420| 74 28 72 2c 20 2d 6b 48 | 61 6c 66 44 6f 74 53 69 |t(r, -kH|alfDotSi|
|00002430| 7a 65 2c 20 2d 6b 48 61 | 6c 66 44 6f 74 53 69 7a |ze, -kHa|lfDotSiz|
|00002440| 65 2c 20 09 09 09 09 09 | 09 6b 48 61 6c 66 44 6f |e, .....|.kHalfDo|
|00002450| 74 53 69 7a 65 2b 31 2c | 20 6b 48 61 6c 66 44 6f |tSize+1,| kHalfDo|
|00002460| 74 53 69 7a 65 2b 31 29 | 3b 0d 09 4f 66 66 73 65 |tSize+1)|;..Offse|
|00002470| 74 52 65 63 74 28 72 2c | 20 63 65 6e 74 65 72 2e |tRect(r,| center.|
|00002480| 68 2c 20 63 65 6e 74 65 | 72 2e 76 29 3b 0d 45 4e |h, cente|r.v);.EN|
|00002490| 44 3b 0d 09 0d 09 0d 7b | 20 48 65 72 65 20 69 73 |D;.....{| Here is|
|000024a0| 20 74 68 65 20 44 72 61 | 77 20 6d 65 74 68 6f 64 | the Dra|w method|
|000024b0| 20 66 6f 72 20 74 68 65 | 20 73 63 6f 72 65 20 76 | for the| score v|
|000024c0| 69 65 77 2e 20 7d 0d 0d | 50 52 4f 43 45 44 55 52 |iew. }..|PROCEDUR|
|000024d0| 45 20 54 53 63 6f 72 65 | 56 69 65 77 2e 44 72 61 |E TScore|View.Dra|
|000024e0| 77 28 61 72 65 61 3a 20 | 52 65 63 74 29 3b 20 4f |w(area: |Rect); O|
|000024f0| 56 45 52 52 49 44 45 3b | 0d 0d 09 56 41 52 09 73 |VERRIDE;|...VAR.s|
|00002500| 63 6f 72 65 3a 09 09 53 | 63 6f 72 65 41 72 72 61 |core:..S|coreArra|
|00002510| 79 3b 0d 09 09 70 6c 61 | 79 65 72 3a 09 09 42 4f |y;...pla|yer:..BO|
|00002520| 4f 4c 45 41 4e 3b 0d 09 | 09 72 3a 09 09 09 52 65 |OLEAN;..|.r:...Re|
|00002530| 63 74 3b 0d 09 09 73 3a | 09 09 09 53 74 72 32 35 |ct;...s:|...Str25|
|00002540| 35 3b 0d 09 09 6f 66 66 | 73 65 74 3a 09 09 49 4e |5;...off|set:..IN|
|00002550| 54 45 47 45 52 3b 0d 42 | 45 47 49 4e 0d 09 54 65 |TEGER;.B|EGIN..Te|
|00002560| 78 74 46 6f 6e 74 28 6d | 6f 6e 61 63 6f 29 3b 0d |xtFont(m|onaco);.|
|00002570| 09 54 65 78 74 46 61 63 | 65 28 5b 5d 29 3b 0d 09 |.TextFac|e([]);..|
|00002580| 54 65 78 74 53 69 7a 65 | 28 39 29 3b 0d 09 50 65 |TextSize|(9);..Pe|
|00002590| 6e 4e 6f 72 6d 61 6c 3b | 0d 09 50 65 6e 53 69 7a |nNormal;|..PenSiz|
|000025a0| 65 28 6b 53 63 6f 72 65 | 49 6e 73 65 74 2c 20 6b |e(kScore|Inset, k|
|000025b0| 53 63 6f 72 65 49 6e 73 | 65 74 29 3b 0d 09 09 0d |ScoreIns|et);....|
|000025c0| 09 66 44 6f 74 44 6f 63 | 75 6d 65 6e 74 2e 43 61 |.fDotDoc|ument.Ca|
|000025d0| 6c 63 75 6c 61 74 65 53 | 63 6f 72 65 28 73 63 6f |lculateS|core(sco|
|000025e0| 72 65 29 3b 0d 0d 09 46 | 4f 52 20 70 6c 61 79 65 |re);...F|OR playe|
|000025f0| 72 20 3a 3d 20 6b 50 6c | 61 79 65 72 31 20 44 4f |r := kPl|ayer1 DO|
|00002600| 57 4e 54 4f 20 6b 50 6c | 61 79 65 72 32 20 44 4f |WNTO kPl|ayer2 DO|
|00002610| 20 42 45 47 49 4e 0d 09 | 09 4e 75 6d 54 6f 53 74 | BEGIN..|.NumToSt|
|00002620| 72 69 6e 67 28 73 63 6f | 72 65 5b 70 6c 61 79 65 |ring(sco|re[playe|
|00002630| 72 5d 2c 20 73 29 3b 0d | 0d 09 7b 20 63 65 6e 74 |r], s);.|..{ cent|
|00002640| 65 72 20 73 63 6f 72 65 | 20 69 6e 20 74 68 65 20 |er score| in the |
|00002650| 70 6c 61 79 65 72 27 73 | 20 72 65 63 74 61 6e 67 |player's| rectang|
|00002660| 6c 65 20 7d 0d 09 09 47 | 65 74 50 6c 61 79 65 72 |le }...G|etPlayer|
|00002670| 52 65 63 74 28 70 6c 61 | 79 65 72 2c 20 72 29 3b |Rect(pla|yer, r);|
|00002680| 0d 09 09 6f 66 66 73 65 | 74 20 3a 3d 20 28 72 2e |...offse|t := (r.|
|00002690| 72 69 67 68 74 20 2d 20 | 72 2e 6c 65 66 74 20 2d |right - |r.left -|
|000026a0| 20 53 74 72 69 6e 67 57 | 69 64 74 68 28 73 29 29 | StringW|idth(s))|
|000026b0| 20 44 49 56 20 32 3b 0d | 09 09 4d 6f 76 65 54 6f | DIV 2;.|..MoveTo|
|000026c0| 28 72 2e 6c 65 66 74 20 | 2b 20 6f 66 66 73 65 74 |(r.left |+ offset|
|000026d0| 2c 20 72 2e 62 6f 74 74 | 6f 6d 2d 33 29 3b 0d 09 |, r.bott|om-3);..|
|000026e0| 09 44 72 61 77 53 74 72 | 69 6e 67 28 73 29 3b 0d |.DrawStr|ing(s);.|
|000026f0| 09 09 09 0d 09 09 49 6e | 73 65 74 52 65 63 74 28 |......In|setRect(|
|00002700| 72 2c 20 2d 6b 53 63 6f | 72 65 49 6e 73 65 74 2c |r, -kSco|reInset,|
|00002710| 20 2d 6b 53 63 6f 72 65 | 49 6e 73 65 74 29 3b 0d | -kScore|Inset);.|
|00002720| 09 09 50 65 6e 50 61 74 | 28 67 50 6c 61 79 65 72 |..PenPat|(gPlayer|
|00002730| 50 61 74 73 5b 70 6c 61 | 79 65 72 5d 29 3b 0d 09 |Pats[pla|yer]);..|
|00002740| 09 46 72 61 6d 65 52 65 | 63 74 28 72 29 3b 0d 09 |.FrameRe|ct(r);..|
|00002750| 09 45 4e 44 3b 0d 09 09 | 0d 09 47 65 74 50 6c 61 |.END;...|..GetPla|
|00002760| 79 65 72 52 65 63 74 28 | 66 50 6c 61 79 65 72 31 |yerRect(|fPlayer1|
|00002770| 54 75 72 6e 2c 20 72 29 | 3b 0d 09 49 6e 76 65 72 |Turn, r)|;..Inver|
|00002780| 74 52 65 63 74 28 72 29 | 3b 0d 45 4e 44 3b 0d 09 |tRect(r)|;.END;..|
|00002790| 0d 0d 7b 20 54 68 69 73 | 20 63 6f 6d 70 75 74 65 |..{ This| compute|
|000027a0| 73 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 73 63 |s the cu|rrent sc|
|000027b0| 6f 72 65 2e 20 20 57 65 | 20 63 6f 75 6c 64 20 68 |ore. We| could h|
|000027c0| 61 76 65 20 73 74 6f 72 | 65 64 20 74 68 65 20 0d |ave stor|ed the .|
|000027d0| 73 63 6f 72 65 20 69 6e | 20 74 68 65 20 64 6f 63 |score in| the doc|
|000027e0| 75 6d 65 6e 74 20 6f 62 | 6a 65 63 74 20 61 6e 64 |ument ob|ject and|
|000027f0| 20 75 70 64 61 74 65 64 | 20 69 74 20 6f 6e 20 74 | updated| it on t|
|00002800| 68 65 20 66 6c 79 2c 20 | 62 75 74 20 74 68 69 73 |he fly, |but this|
|00002810| 20 0d 77 61 73 20 65 61 | 73 69 65 72 2e 7d 0d 09 | .was ea|sier.}..|
|00002820| 0d 50 52 4f 43 45 44 55 | 52 45 20 54 44 6f 74 44 |.PROCEDU|RE TDotD|
|00002830| 6f 63 75 6d 65 6e 74 2e | 43 61 6c 63 75 6c 61 74 |ocument.|Calculat|
|00002840| 65 53 63 6f 72 65 28 0d | 09 09 09 09 09 09 56 41 |eScore(.|......VA|
|00002850| 52 20 74 68 65 53 63 6f | 72 65 3a 20 53 63 6f 72 |R theSco|re: Scor|
|00002860| 65 41 72 72 61 79 29 3b | 0d 09 56 41 52 09 72 6f |eArray);|..VAR.ro|
|00002870| 77 3a 09 49 4e 54 45 47 | 45 52 3b 0d 09 09 63 6f |w:.INTEG|ER;...co|
|00002880| 6c 3a 09 49 4e 54 45 47 | 45 52 3b 0d 42 45 47 49 |l:.INTEG|ER;.BEGI|
|00002890| 4e 0d 09 74 68 65 53 63 | 6f 72 65 5b 6b 50 6c 61 |N..theSc|ore[kPla|
|000028a0| 79 65 72 31 5d 20 3a 3d | 20 30 3b 0d 09 74 68 65 |yer1] :=| 0;..the|
|000028b0| 53 63 6f 72 65 5b 6b 50 | 6c 61 79 65 72 32 5d 20 |Score[kP|layer2] |
|000028c0| 3a 3d 20 30 3b 0d 09 46 | 4f 52 20 72 6f 77 20 3a |:= 0;..F|OR row :|
|000028d0| 3d 20 31 20 54 4f 20 6b | 44 6f 74 73 50 65 72 52 |= 1 TO k|DotsPerR|
|000028e0| 6f 77 2d 31 20 44 4f 0d | 09 09 46 4f 52 20 63 6f |ow-1 DO.|..FOR co|
|000028f0| 6c 20 3a 3d 20 31 20 54 | 4f 20 6b 44 6f 74 73 50 |l := 1 T|O kDotsP|
|00002900| 65 72 52 6f 77 2d 31 20 | 44 4f 0d 09 09 09 43 41 |erRow-1 |DO....CA|
|00002910| 53 45 20 66 42 6f 78 65 | 73 5b 72 6f 77 2c 20 63 |SE fBoxe|s[row, c|
|00002920| 6f 6c 5d 20 4f 46 0d 09 | 09 09 09 6b 42 6f 78 50 |ol] OF..|...kBoxP|
|00002930| 6c 61 79 65 72 31 3a 09 | 0d 09 09 09 09 09 74 68 |layer1:.|......th|
|00002940| 65 53 63 6f 72 65 5b 6b | 50 6c 61 79 65 72 31 5d |eScore[k|Player1]|
|00002950| 20 3a 3d 20 09 09 09 09 | 09 09 09 74 68 65 53 63 | := ....|...theSc|
|00002960| 6f 72 65 5b 6b 50 6c 61 | 79 65 72 31 5d 20 2b 20 |ore[kPla|yer1] + |
|00002970| 31 3b 0d 09 09 09 09 6b | 42 6f 78 50 6c 61 79 65 |1;.....k|BoxPlaye|
|00002980| 72 32 3a 09 0d 09 09 09 | 09 09 74 68 65 53 63 6f |r2:.....|..theSco|
|00002990| 72 65 5b 6b 50 6c 61 79 | 65 72 32 5d 20 3a 3d 20 |re[kPlay|er2] := |
|000029a0| 09 09 09 09 09 09 09 74 | 68 65 53 63 6f 72 65 5b |.......t|heScore[|
|000029b0| 6b 50 6c 61 79 65 72 32 | 5d 20 2b 20 31 3b 0d 09 |kPlayer2|] + 1;..|
|000029c0| 09 09 45 4e 44 3b 0d 45 | 4e 44 3b 0d 09 0d 0d 7b |..END;.E|ND;....{|
|000029d0| 20 54 68 69 73 20 67 65 | 74 73 20 74 68 65 20 72 | This ge|ts the r|
|000029e0| 65 63 74 61 6e 67 6c 65 | 20 69 6e 20 77 68 69 63 |ectangle| in whic|
|000029f0| 68 20 74 6f 20 64 72 61 | 77 20 74 68 65 20 70 6c |h to dra|w the pl|
|00002a00| 61 79 65 72 27 73 20 73 | 63 6f 72 65 2e 20 7d 0d |ayer's s|core. }.|
|00002a10| 0d 50 52 4f 43 45 44 55 | 52 45 20 54 53 63 6f 72 |.PROCEDU|RE TScor|
|00002a20| 65 56 69 65 77 2e 47 65 | 74 50 6c 61 79 65 72 52 |eView.Ge|tPlayerR|
|00002a30| 65 63 74 28 0d 09 09 09 | 09 66 6f 72 50 6c 61 79 |ect(....|.forPlay|
|00002a40| 65 72 31 3a 20 42 4f 4f | 4c 45 41 4e 3b 20 56 41 |er1: BOO|LEAN; VA|
|00002a50| 52 20 72 3a 20 52 65 63 | 74 29 3b 0d 42 45 47 49 |R r: Rec|t);.BEGI|
|00002a60| 4e 0d 09 53 65 74 52 65 | 63 74 28 72 2c 20 6b 44 |N..SetRe|ct(r, kD|
|00002a70| 6f 74 53 70 61 63 69 6e | 67 2c 20 6b 48 61 6c 66 |otSpacin|g, kHalf|
|00002a80| 53 70 61 63 69 6e 67 2c | 20 0d 09 09 09 09 09 32 |Spacing,| ......2|
|00002a90| 2a 6b 44 6f 74 53 70 61 | 63 69 6e 67 2c 20 6b 44 |*kDotSpa|cing, kD|
|00002aa0| 6f 74 53 70 61 63 69 6e | 67 29 3b 0d 09 49 46 20 |otSpacin|g);..IF |
|00002ab0| 4e 4f 54 20 66 6f 72 50 | 6c 61 79 65 72 31 20 0d |NOT forP|layer1 .|
|00002ac0| 09 54 48 45 4e 09 4f 66 | 66 73 65 74 52 65 63 74 |.THEN.Of|fsetRect|
|00002ad0| 28 72 2c 20 6b 53 63 6f | 72 65 53 70 61 63 69 6e |(r, kSco|reSpacin|
|00002ae0| 67 2c 20 30 29 3b 0d 45 | 4e 44 3b 0d 09 0d 09 0d |g, 0);.E|ND;.....|
|00002af0| 7b 20 54 68 65 20 6e 65 | 78 74 20 70 61 72 74 20 |{ The ne|xt part |
|00002b00| 6f 66 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 64 |of the p|rogram d|
|00002b10| 65 61 6c 73 20 77 69 74 | 68 20 68 61 6e 64 6c 69 |eals wit|h handli|
|00002b20| 6e 67 20 61 20 6d 6f 75 | 73 65 20 0d 63 6c 69 63 |ng a mou|se .clic|
|00002b30| 6b 20 69 6e 20 74 68 65 | 20 67 72 69 64 2e 20 7d |k in the| grid. }|
|00002b40| 0d 0d 0d 7b 20 57 68 65 | 6e 20 74 68 65 20 75 73 |...{ Whe|n the us|
|00002b50| 65 72 20 63 6c 69 63 6b | 73 20 74 68 65 20 6d 6f |er click|s the mo|
|00002b60| 75 73 65 20 4d 61 63 41 | 70 70 20 63 61 6c 6c 73 |use MacA|pp calls|
|00002b70| 20 74 68 65 20 0d 44 6f | 4d 6f 75 73 65 43 6f 6d | the .Do|MouseCom|
|00002b80| 6d 61 6e 64 20 6d 65 74 | 68 6f 64 2e 20 20 54 68 |mand met|hod. Th|
|00002b90| 69 73 20 72 65 74 75 72 | 6e 73 20 61 6e 20 61 70 |is retur|ns an ap|
|00002ba0| 70 72 6f 70 72 69 61 74 | 65 20 0d 63 6f 6d 6d 61 |propriat|e .comma|
|00002bb0| 6e 64 20 6f 62 6a 65 63 | 74 2c 20 77 68 69 63 68 |nd objec|t, which|
|00002bc0| 20 74 68 65 6e 20 74 72 | 61 63 6b 73 20 74 68 65 | then tr|acks the|
|00002bd0| 20 6d 6f 75 73 65 2e 20 | 7d 0d 09 0d 46 55 4e 43 | mouse. |}...FUNC|
|00002be0| 54 49 4f 4e 20 20 54 44 | 6f 74 56 69 65 77 2e 44 |TION TD|otView.D|
|00002bf0| 6f 4d 6f 75 73 65 43 6f | 6d 6d 61 6e 64 28 0d 09 |oMouseCo|mmand(..|
|00002c00| 09 56 41 52 20 64 6f 77 | 6e 4c 6f 63 61 6c 50 6f |.VAR dow|nLocalPo|
|00002c10| 69 6e 74 3a 20 50 6f 69 | 6e 74 3b 0d 09 09 56 41 |int: Poi|nt;...VA|
|00002c20| 52 20 69 6e 66 6f 3a 20 | 45 76 65 6e 74 49 6e 66 |R info: |EventInf|
|00002c30| 6f 3b 20 0d 09 09 56 41 | 52 20 68 79 73 74 65 72 |o; ...VA|R hyster|
|00002c40| 65 73 69 73 3a 20 50 6f | 69 6e 74 29 3a 20 54 43 |esis: Po|int): TC|
|00002c50| 6f 6d 6d 61 6e 64 3b 20 | 4f 56 45 52 52 49 44 45 |ommand; |OVERRIDE|
|00002c60| 3b 0d 0d 09 56 41 52 09 | 64 6f 74 43 6d 64 3a 09 |;...VAR.|dotCmd:.|
|00002c70| 09 54 44 6f 74 43 6f 6d | 6d 61 6e 64 3b 0d 42 45 |.TDotCom|mand;.BE|
|00002c80| 47 49 4e 0d 7b 20 49 6e | 20 74 68 69 73 20 63 61 |GIN.{ In| this ca|
|00002c90| 73 65 2c 20 77 65 20 68 | 61 76 65 20 6f 6e 6c 79 |se, we h|ave only|
|00002ca0| 20 6f 6e 65 20 6b 69 6e | 64 20 6f 66 20 6d 6f 75 | one kin|d of mou|
|00002cb0| 73 65 20 63 6f 6d 6d 61 | 6e 64 2e 20 7d 0d 09 4e |se comma|nd. }..N|
|00002cc0| 65 77 28 64 6f 74 43 6d | 64 29 3b 0d 09 46 61 69 |ew(dotCm|d);..Fai|
|00002cd0| 6c 4e 49 4c 28 64 6f 74 | 43 6d 64 29 3b 0d 09 64 |lNIL(dot|Cmd);..d|
|00002ce0| 6f 74 43 6d 64 2e 49 44 | 6f 74 43 6f 6d 6d 61 6e |otCmd.ID|otComman|
|00002cf0| 64 28 53 45 4c 46 29 3b | 0d 09 44 6f 4d 6f 75 73 |d(SELF);|..DoMous|
|00002d00| 65 43 6f 6d 6d 61 6e 64 | 20 3a 3d 20 64 6f 74 43 |eCommand| := dotC|
|00002d10| 6d 64 3b 0d 45 4e 44 3b | 0d 09 0d 0d 7b 20 54 68 |md;.END;|....{ Th|
|00002d20| 69 73 20 69 6e 69 74 69 | 61 6c 69 7a 65 73 20 74 |is initi|alizes t|
|00002d30| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6f 62 6a 65 63 |he comma|nd objec|
|00002d40| 74 2e 20 7d 0d 0d 50 52 | 4f 43 45 44 55 52 45 20 |t. }..PR|OCEDURE |
|00002d50| 54 44 6f 74 43 6f 6d 6d | 61 6e 64 2e 49 44 6f 74 |TDotComm|and.IDot|
|00002d60| 43 6f 6d 6d 61 6e 64 28 | 0d 09 09 09 09 09 09 69 |Command(|.......i|
|00002d70| 74 73 44 6f 74 56 69 65 | 77 3a 20 54 44 6f 74 56 |tsDotVie|w: TDotV|
|00002d80| 69 65 77 29 3b 0d 42 45 | 47 49 4e 0d 09 49 43 6f |iew);.BE|GIN..ICo|
|00002d90| 6d 6d 61 6e 64 28 6b 4c | 61 73 74 4d 6f 76 65 43 |mmand(kL|astMoveC|
|00002da0| 6f 6d 6d 61 6e 64 29 3b | 0d 09 66 43 6f 6e 73 74 |ommand);|..fConst|
|00002db0| 72 61 69 6e 73 4d 6f 75 | 73 65 20 3a 3d 20 54 52 |rainsMou|se := TR|
|00002dc0| 55 45 3b 0d 09 09 0d 09 | 66 44 6f 74 56 69 65 77 |UE;.....|fDotView|
|00002dd0| 20 3a 3d 20 69 74 73 44 | 6f 74 56 69 65 77 3b 0d | := itsD|otView;.|
|00002de0| 09 66 44 6f 74 44 6f 63 | 75 6d 65 6e 74 20 3a 3d |.fDotDoc|ument :=|
|00002df0| 20 69 74 73 44 6f 74 56 | 69 65 77 2e 66 44 6f 74 | itsDotV|iew.fDot|
|00002e00| 44 6f 63 75 6d 65 6e 74 | 3b 0d 09 66 50 6c 61 79 |Document|;..fPlay|
|00002e10| 65 72 31 20 3a 3d 20 66 | 44 6f 74 44 6f 63 75 6d |er1 := f|DotDocum|
|00002e20| 65 6e 74 2e 66 50 6c 61 | 79 65 72 31 54 75 72 6e |ent.fPla|yer1Turn|
|00002e30| 3b 0d 09 09 0d 09 66 44 | 69 72 65 63 74 69 6f 6e |;.....fD|irection|
|00002e40| 20 3a 3d 20 68 4c 69 6e | 65 3b 0d 09 66 52 6f 77 | := hLin|e;..fRow|
|00002e50| 20 3a 3d 20 30 3b 0d 09 | 66 43 6f 6c 20 3a 3d 20 | := 0;..|fCol := |
|00002e60| 30 3b 0d 45 4e 44 3b 0d | 09 0d 0d 7b 20 4f 6e 63 |0;.END;.|...{ Onc|
|00002e70| 65 20 4d 61 63 41 70 70 | 20 67 65 74 73 20 74 68 |e MacApp| gets th|
|00002e80| 65 20 63 6f 6d 6d 61 6e | 64 20 6f 62 6a 65 63 74 |e comman|d object|
|00002e90| 2c 20 69 74 20 72 75 6e | 73 20 61 20 6c 6f 6f 70 |, it run|s a loop|
|00002ea0| 20 61 73 20 0d 6c 6f 6e | 67 20 61 73 20 74 68 65 | as .lon|g as the|
|00002eb0| 20 75 73 65 72 20 68 6f | 6c 64 73 20 74 68 65 20 | user ho|lds the |
|00002ec0| 62 75 74 74 6f 6e 20 64 | 6f 77 6e 2e 20 20 49 6e |button d|own. In|
|00002ed0| 20 74 68 65 20 6c 6f 6f | 70 2c 20 4d 61 63 41 70 | the loo|p, MacAp|
|00002ee0| 70 20 0d 63 6f 6e 74 69 | 6e 75 61 6c 6c 79 20 63 |p .conti|nually c|
|00002ef0| 61 6c 6c 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |alls the| followi|
|00002f00| 6e 67 20 74 72 61 63 6b | 69 6e 67 20 6d 65 74 68 |ng track|ing meth|
|00002f10| 6f 64 73 2e 20 7d 0d 09 | 0d 7b 20 54 68 69 73 20 |ods. }..|.{ This |
|00002f20| 69 73 20 75 73 65 64 20 | 74 6f 20 67 69 76 65 20 |is used |to give |
|00002f30| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 6f 62 6a 65 |the comm|and obje|
|00002f40| 63 74 20 61 20 63 68 61 | 6e 63 65 20 74 6f 20 6d |ct a cha|nce to m|
|00002f50| 6f 64 69 66 79 20 0d 74 | 68 65 20 61 63 74 75 61 |odify .t|he actua|
|00002f60| 6c 20 6d 6f 75 73 65 20 | 70 6f 69 6e 74 20 62 65 |l mouse |point be|
|00002f70| 66 6f 72 65 20 69 74 20 | 69 73 20 68 61 6e 64 6c |fore it |is handl|
|00002f80| 65 64 2e 20 7d 0d 09 0d | 50 52 4f 43 45 44 55 52 |ed. }...|PROCEDUR|
|00002f90| 45 20 54 44 6f 74 43 6f | 6d 6d 61 6e 64 2e 54 72 |E TDotCo|mmand.Tr|
|00002fa0| 61 63 6b 43 6f 6e 73 74 | 72 61 69 6e 28 0d 09 09 |ackConst|rain(...|
|00002fb0| 09 09 61 6e 63 68 6f 72 | 50 6f 69 6e 74 2c 20 70 |..anchor|Point, p|
|00002fc0| 72 65 76 69 6f 75 73 50 | 6f 69 6e 74 3a 20 50 6f |reviousP|oint: Po|
|00002fd0| 69 6e 74 3b 20 0d 09 09 | 09 09 56 41 52 20 6e 65 |int; ...|..VAR ne|
|00002fe0| 78 74 50 6f 69 6e 74 3a | 20 50 6f 69 6e 74 29 3b |xtPoint:| Point);|
|00002ff0| 20 4f 56 45 52 52 49 44 | 45 3b 0d 09 56 41 52 09 | OVERRID|E;..VAR.|
|00003000| 64 69 72 65 63 74 69 6f | 6e 3a 09 4c 69 6e 65 44 |directio|n:.LineD|
|00003010| 69 72 3b 0d 09 09 72 6f | 77 3a 09 09 49 4e 54 45 |ir;...ro|w:..INTE|
|00003020| 47 45 52 3b 0d 09 09 63 | 6f 6c 3a 09 09 49 4e 54 |GER;...c|ol:..INT|
|00003030| 45 47 45 52 3b 0d 42 45 | 47 49 4e 0d 7b 20 49 6e |EGER;.BE|GIN.{ In|
|00003040| 20 74 68 69 73 20 63 61 | 73 65 2c 20 69 66 20 74 | this ca|se, if t|
|00003050| 68 65 20 6d 6f 75 73 65 | 20 69 73 20 6f 76 65 72 |he mouse| is over|
|00003060| 20 61 20 6c 69 6e 65 2c | 20 61 6e 64 20 74 68 65 | a line,| and the|
|00003070| 20 6c 69 6e 65 20 69 73 | 20 0d 75 6e 6f 63 63 75 | line is| .unoccu|
|00003080| 70 69 65 64 2c 20 77 65 | 20 63 68 61 6e 67 65 20 |pied, we| change |
|00003090| 74 68 65 20 6d 6f 75 73 | 65 20 70 6f 69 6e 74 20 |the mous|e point |
|000030a0| 69 6e 74 6f 20 61 20 63 | 61 6e 6f 6e 69 63 61 6c |into a c|anonical|
|000030b0| 20 70 6f 69 6e 74 20 0d | 66 6f 72 20 74 68 61 74 | point .|for that|
|000030c0| 20 6c 69 6e 65 2e 20 20 | 54 68 69 73 20 6d 65 61 | line. |This mea|
|000030d0| 6e 73 20 74 68 61 74 20 | 69 66 20 74 68 65 20 20 |ns that |if the |
|000030e0| 75 73 65 72 20 70 6f 69 | 6e 74 73 20 74 6f 20 74 |user poi|nts to t|
|000030f0| 68 65 20 73 61 6d 65 20 | 0d 6c 69 6e 65 2c 20 74 |he same |.line, t|
|00003100| 68 65 20 54 72 61 63 6b | 4d 6f 75 73 65 20 6d 65 |he Track|Mouse me|
|00003110| 74 68 6f 64 20 28 62 65 | 6c 6f 77 29 20 20 77 69 |thod (be|low) wi|
|00003120| 6c 6c 20 72 65 63 65 69 | 76 65 20 74 68 65 20 73 |ll recei|ve the s|
|00003130| 61 6d 65 20 0d 63 6f 6f | 72 64 69 6e 61 74 65 20 |ame .coo|rdinate |
|00003140| 65 76 65 6e 20 69 66 20 | 74 68 65 20 6d 6f 75 73 |even if |the mous|
|00003150| 65 20 6d 6f 76 65 73 20 | 20 73 6c 69 67 68 74 6c |e moves | slightl|
|00003160| 79 2e 20 20 54 68 69 73 | 20 70 72 65 76 65 6e 74 |y. This| prevent|
|00003170| 73 20 0d 74 68 65 20 68 | 69 67 68 6c 69 67 68 74 |s .the h|ighlight|
|00003180| 69 6e 67 20 66 72 6f 6d | 20 66 6c 69 63 6b 65 72 |ing from| flicker|
|00003190| 69 6e 67 2e 20 7d 0d 09 | 09 09 09 0d 09 49 46 20 |ing. }..|.....IF |
|000031a0| 66 44 6f 74 56 69 65 77 | 2e 50 74 32 4c 69 6e 65 |fDotView|.Pt2Line|
|000031b0| 28 6e 65 78 74 50 6f 69 | 6e 74 2c 20 64 69 72 65 |(nextPoi|nt, dire|
|000031c0| 63 74 69 6f 6e 2c 20 72 | 6f 77 2c 20 63 6f 6c 29 |ction, r|ow, col)|
|000031d0| 20 0d 09 54 48 45 4e 20 | 42 45 47 49 4e 0d 09 09 | ..THEN |BEGIN...|
|000031e0| 49 46 20 66 44 6f 74 44 | 6f 63 75 6d 65 6e 74 2e |IF fDotD|ocument.|
|000031f0| 47 65 74 4c 69 6e 65 53 | 74 61 74 65 28 64 69 72 |GetLineS|tate(dir|
|00003200| 65 63 74 69 6f 6e 2c 20 | 72 6f 77 2c 20 63 6f 6c |ection, |row, col|
|00003210| 29 20 0d 09 09 54 48 45 | 4e 20 42 45 47 49 4e 0d |) ...THE|N BEGIN.|
|00003220| 09 09 7b 20 74 68 65 20 | 6c 69 6e 65 20 69 73 20 |..{ the |line is |
|00003230| 61 6c 72 65 61 64 79 20 | 6f 63 63 75 70 69 65 64 |already |occupied|
|00003240| 20 7d 0d 09 09 09 72 6f | 77 20 3a 3d 20 30 3b 0d | }....ro|w := 0;.|
|00003250| 09 09 09 63 6f 6c 20 3a | 3d 20 30 3b 0d 09 09 45 |...col :|= 0;...E|
|00003260| 4e 44 3b 0d 09 09 09 0d | 09 09 66 44 6f 74 56 69 |ND;.....|..fDotVi|
|00003270| 65 77 2e 4c 69 6e 65 32 | 50 74 28 64 69 72 65 63 |ew.Line2|Pt(direc|
|00003280| 74 69 6f 6e 2c 20 72 6f | 77 2c 20 63 6f 6c 2c 20 |tion, ro|w, col, |
|00003290| 6e 65 78 74 50 6f 69 6e | 74 29 3b 0d 09 45 4e 44 |nextPoin|t);..END|
|000032a0| 3b 0d 45 4e 44 3b 0d 09 | 0d 0d 7b 20 54 68 69 73 |;.END;..|..{ This|
|000032b0| 20 6d 65 74 68 6f 64 20 | 70 72 6f 76 69 64 65 73 | method |provides|
|000032c0| 20 68 69 67 68 6c 69 67 | 68 74 69 6e 67 20 77 68 | highlig|hting wh|
|000032d0| 69 6c 65 20 74 72 61 63 | 6b 69 6e 67 2e 20 20 20 |ile trac|king. |
|000032e0| 54 68 65 20 76 61 6c 75 | 65 20 0d 6f 66 20 6e 65 |The valu|e .of ne|
|000032f0| 78 74 50 6f 69 6e 74 20 | 69 73 20 74 68 61 74 20 |xtPoint |is that |
|00003300| 72 65 74 75 72 6e 65 64 | 20 62 79 20 54 72 61 63 |returned| by Trac|
|00003310| 6b 43 6f 6e 73 74 72 61 | 69 6e 2e 20 7d 0d 0d 50 |kConstra|in. }..P|
|00003320| 52 4f 43 45 44 55 52 45 | 20 54 44 6f 74 43 6f 6d |ROCEDURE| TDotCom|
|00003330| 6d 61 6e 64 2e 54 72 61 | 63 6b 46 65 65 64 62 61 |mand.Tra|ckFeedba|
|00003340| 63 6b 28 0d 09 09 61 6e | 63 68 6f 72 50 6f 69 6e |ck(...an|chorPoin|
|00003350| 74 2c 20 6e 65 78 74 50 | 6f 69 6e 74 3a 20 50 6f |t, nextP|oint: Po|
|00003360| 69 6e 74 3b 20 0d 09 09 | 74 75 72 6e 49 74 4f 6e |int; ...|turnItOn|
|00003370| 2c 20 6d 6f 75 73 65 44 | 69 64 4d 6f 76 65 3a 20 |, mouseD|idMove: |
|00003380| 42 4f 4f 4c 45 41 4e 29 | 3b 20 4f 56 45 52 52 49 |BOOLEAN)|; OVERRI|
|00003390| 44 45 3b 0d 0d 09 56 41 | 52 09 64 69 72 65 63 74 |DE;...VA|R.direct|
|000033a0| 69 6f 6e 3a 09 4c 69 6e | 65 44 69 72 3b 0d 09 09 |ion:.Lin|eDir;...|
|000033b0| 72 6f 77 3a 09 09 49 4e | 54 45 47 45 52 3b 0d 09 |row:..IN|TEGER;..|
|000033c0| 09 63 6f 6c 3a 09 09 49 | 4e 54 45 47 45 52 3b 0d |.col:..I|NTEGER;.|
|000033d0| 09 09 72 3a 09 09 09 52 | 65 63 74 3b 0d 42 45 47 |..r:...R|ect;.BEG|
|000033e0| 49 4e 0d 7b 20 44 6f 6e | 27 74 20 64 6f 20 61 6e |IN.{ Don|'t do an|
|000033f0| 79 74 68 69 6e 67 20 69 | 66 20 74 68 65 20 6d 6f |ything i|f the mo|
|00003400| 75 73 65 20 64 6f 65 73 | 6e 27 74 20 6d 6f 76 65 |use does|n't move|
|00003410| 2c 20 74 6f 20 70 72 65 | 76 65 6e 74 20 0d 66 6c |, to pre|vent .fl|
|00003420| 69 63 6b 65 72 2e 20 20 | 42 65 63 61 75 73 65 20 |icker. |Because |
|00003430| 6f 66 20 74 68 65 20 63 | 6f 6e 73 74 72 61 69 6e |of the c|onstrain|
|00003440| 69 6e 67 20 61 62 6f 76 | 65 2c 20 20 6d 6f 75 73 |ing abov|e, mous|
|00003450| 65 44 69 64 4d 6f 76 65 | 20 0d 77 69 6c 6c 20 62 |eDidMove| .will b|
|00003460| 65 20 46 41 4c 53 45 20 | 75 6e 74 69 6c 20 74 68 |e FALSE |until th|
|00003470| 65 20 75 73 65 72 20 6d | 6f 76 65 73 20 63 6f 6d |e user m|oves com|
|00003480| 70 6c 65 74 65 6c 79 20 | 6f 66 66 20 74 68 65 20 |pletely |off the |
|00003490| 70 72 65 76 69 6f 75 73 | 20 0d 6c 69 6e 65 2c 20 |previous| .line, |
|000034a0| 65 76 65 6e 20 69 66 20 | 74 68 65 20 6d 6f 75 73 |even if |the mous|
|000034b0| 65 20 61 63 74 75 61 6c | 6c 79 20 64 6f 65 73 20 |e actual|ly does |
|000034c0| 6d 6f 76 65 2e 20 7d 0d | 09 49 46 20 6d 6f 75 73 |move. }.|.IF mous|
|000034d0| 65 44 69 64 4d 6f 76 65 | 0d 09 54 48 45 4e 20 42 |eDidMove|..THEN B|
|000034e0| 45 47 49 4e 0d 09 7b 20 | 69 66 20 74 68 65 20 6d |EGIN..{ |if the m|
|000034f0| 6f 75 73 65 20 69 73 20 | 6f 76 65 72 20 61 20 6c |ouse is |over a l|
|00003500| 69 6e 65 2c 20 69 6e 76 | 65 72 74 20 69 74 3b 20 |ine, inv|ert it; |
|00003510| 54 72 61 63 6b 43 6f 6e | 73 74 72 61 69 6e 20 09 |TrackCon|strain .|
|00003520| 61 6c 72 65 61 64 79 20 | 6d 61 64 65 20 73 75 72 |already |made sur|
|00003530| 65 20 74 68 61 74 20 74 | 68 65 20 6c 69 6e 65 20 |e that t|he line |
|00003540| 69 73 20 75 6e 6f 63 63 | 75 70 69 65 64 20 7d 0d |is unocc|upied }.|
|00003550| 09 09 49 46 20 66 44 6f | 74 56 69 65 77 2e 50 74 |..IF fDo|tView.Pt|
|00003560| 32 4c 69 6e 65 28 6e 65 | 78 74 50 6f 69 6e 74 2c |2Line(ne|xtPoint,|
|00003570| 20 64 69 72 65 63 74 69 | 6f 6e 2c 20 72 6f 77 2c | directi|on, row,|
|00003580| 20 63 6f 6c 29 20 0d 09 | 09 54 48 45 4e 20 42 45 | col) ..|.THEN BE|
|00003590| 47 49 4e 0d 09 09 09 66 | 44 6f 74 56 69 65 77 2e |GIN....f|DotView.|
|000035a0| 4c 69 6e 65 32 52 65 63 | 74 28 64 69 72 65 63 74 |Line2Rec|t(direct|
|000035b0| 69 6f 6e 2c 20 72 6f 77 | 2c 20 63 6f 6c 2c 20 72 |ion, row|, col, r|
|000035c0| 29 3b 0d 09 09 09 49 6e | 76 65 72 74 52 65 63 74 |);....In|vertRect|
|000035d0| 28 72 29 3b 0d 09 09 45 | 4e 44 3b 0d 09 45 4e 44 |(r);...E|ND;..END|
|000035e0| 3b 0d 45 4e 44 3b 0d 09 | 0d 0d 7b 20 54 72 61 63 |;.END;..|..{ Trac|
|000035f0| 6b 4d 6f 75 73 65 20 61 | 63 74 75 61 6c 6c 79 20 |kMouse a|ctually |
|00003600| 72 65 63 65 69 76 65 73 | 20 74 68 65 20 63 75 72 |receives| the cur|
|00003610| 72 65 6e 74 20 70 6f 73 | 69 74 69 6f 6e 20 6f 66 |rent pos|ition of|
|00003620| 20 74 68 65 20 0d 6d 6f | 75 73 65 2c 20 70 6f 73 | the .mo|use, pos|
|00003630| 73 69 62 6c 79 20 6d 6f | 64 69 66 69 65 64 20 62 |sibly mo|dified b|
|00003640| 79 20 54 72 61 63 6b 43 | 6f 6e 73 74 72 61 69 6e |y TrackC|onstrain|
|00003650| 2e 20 7d 0d 0d 46 55 4e | 43 54 49 4f 4e 20 20 54 |. }..FUN|CTION T|
|00003660| 44 6f 74 43 6f 6d 6d 61 | 6e 64 2e 54 72 61 63 6b |DotComma|nd.Track|
|00003670| 4d 6f 75 73 65 28 0d 09 | 61 54 72 61 63 6b 50 68 |Mouse(..|aTrackPh|
|00003680| 61 73 65 3a 20 54 72 61 | 63 6b 50 68 61 73 65 3b |ase: Tra|ckPhase;|
|00003690| 0d 09 56 41 52 20 61 6e | 63 68 6f 72 50 6f 69 6e |..VAR an|chorPoin|
|000036a0| 74 2c 20 70 72 65 76 69 | 6f 75 73 50 6f 69 6e 74 |t, previ|ousPoint|
|000036b0| 2c 20 6e 65 78 74 50 6f | 69 6e 74 3a 20 50 6f 69 |, nextPo|int: Poi|
|000036c0| 6e 74 3b 0d 09 6d 6f 75 | 73 65 44 69 64 4d 6f 76 |nt;..mou|seDidMov|
|000036d0| 65 3a 20 42 4f 4f 4c 45 | 41 4e 29 3a 20 54 43 6f |e: BOOLE|AN): TCo|
|000036e0| 6d 6d 61 6e 64 3b 20 4f | 56 45 52 52 49 44 45 3b |mmand; O|VERRIDE;|
|000036f0| 0d 09 0d 09 56 41 52 09 | 64 69 72 65 63 74 69 6f |....VAR.|directio|
|00003700| 6e 3a 09 4c 69 6e 65 44 | 69 72 3b 0d 09 09 72 6f |n:.LineD|ir;...ro|
|00003710| 77 3a 09 09 49 4e 54 45 | 47 45 52 3b 0d 09 09 63 |w:..INTE|GER;...c|
|00003720| 6f 6c 3a 09 09 49 4e 54 | 45 47 45 52 3b 0d 42 45 |ol:..INT|EGER;.BE|
|00003730| 47 49 4e 0d 7b 20 54 68 | 65 20 64 65 66 61 75 6c |GIN.{ Th|e defaul|
|00003740| 74 20 69 73 20 74 6f 20 | 72 65 74 75 72 6e 20 74 |t is to |return t|
|00003750| 68 65 20 73 61 6d 65 20 | 63 6f 6d 6d 61 6e 64 2c |he same |command,|
|00003760| 20 74 6f 20 63 6f 6e 74 | 69 6e 75 65 20 0d 74 72 | to cont|inue .tr|
|00003770| 61 63 6b 69 6e 67 2e 20 | 7d 0d 09 54 72 61 63 6b |acking. |}..Track|
|00003780| 4d 6f 75 73 65 20 3a 3d | 20 53 45 4c 46 3b 0d 09 |Mouse :=| SELF;..|
|00003790| 09 0d 7b 20 57 65 20 64 | 6f 6e 27 74 20 63 61 72 |..{ We d|on't car|
|000037a0| 65 20 77 68 61 74 20 68 | 61 70 70 65 6e 73 20 75 |e what h|appens u|
|000037b0| 6e 74 69 6c 20 74 68 65 | 20 75 73 65 72 20 72 65 |ntil the| user re|
|000037c0| 6c 65 61 73 65 73 20 74 | 68 65 20 0d 62 75 74 74 |leases t|he .butt|
|000037d0| 6f 6e 2e 20 7d 0d 09 49 | 46 20 61 54 72 61 63 6b |on. }..I|F aTrack|
|000037e0| 50 68 61 73 65 20 3d 20 | 74 72 61 63 6b 52 65 6c |Phase = |trackRel|
|000037f0| 65 61 73 65 20 0d 09 54 | 48 45 4e 20 42 45 47 49 |ease ..T|HEN BEGI|
|00003800| 4e 0d 09 7b 20 4d 61 6b | 65 20 73 75 72 65 20 74 |N..{ Mak|e sure t|
|00003810| 68 61 74 20 74 68 65 20 | 6d 6f 75 73 65 20 69 73 |hat the |mouse is|
|00003820| 20 6f 76 65 72 20 61 20 | 6c 69 6e 65 2c 20 61 6e | over a |line, an|
|00003830| 64 20 72 65 63 6f 72 64 | 20 09 74 68 65 20 75 73 |d record| .the us|
|00003840| 65 72 27 73 20 63 68 6f | 69 63 65 20 69 66 20 73 |er's cho|ice if s|
|00003850| 6f 20 7d 0d 09 09 49 46 | 20 66 44 6f 74 56 69 65 |o }...IF| fDotVie|
|00003860| 77 2e 50 74 32 4c 69 6e | 65 28 70 72 65 76 69 6f |w.Pt2Lin|e(previo|
|00003870| 75 73 50 6f 69 6e 74 2c | 20 0d 09 09 09 09 09 09 |usPoint,| .......|
|00003880| 09 09 64 69 72 65 63 74 | 69 6f 6e 2c 20 72 6f 77 |..direct|ion, row|
|00003890| 2c 20 63 6f 6c 29 20 0d | 09 09 54 48 45 4e 20 42 |, col) .|..THEN B|
|000038a0| 45 47 49 4e 0d 09 09 09 | 66 44 69 72 65 63 74 69 |EGIN....|fDirecti|
|000038b0| 6f 6e 20 3a 3d 20 64 69 | 72 65 63 74 69 6f 6e 3b |on := di|rection;|
|000038c0| 0d 09 09 09 66 52 6f 77 | 20 3a 3d 20 72 6f 77 3b |....fRow| := row;|
|000038d0| 0d 09 09 09 66 43 6f 6c | 20 3a 3d 20 63 6f 6c 3b |....fCol| := col;|
|000038e0| 0d 09 09 45 4e 44 0d 09 | 09 45 4c 53 45 0d 09 09 |...END..|.ELSE...|
|000038f0| 7b 20 54 65 6c 6c 20 4d | 61 63 41 70 70 20 74 68 |{ Tell M|acApp th|
|00003900| 61 74 20 6e 6f 74 68 69 | 6e 67 20 72 65 61 6c 6c |at nothi|ng reall|
|00003910| 79 20 68 61 70 70 65 6e | 65 64 20 7d 0d 09 09 09 |y happen|ed }....|
|00003920| 54 72 61 63 6b 4d 6f 75 | 73 65 20 3a 3d 20 67 4e |TrackMou|se := gN|
|00003930| 6f 43 68 61 6e 67 65 73 | 3b 0d 09 45 4e 44 3b 0d |oChanges|;..END;.|
|00003940| 45 4e 44 3b 0d 0d 0d 7b | 20 48 65 72 65 20 61 72 |END;...{| Here ar|
|00003950| 65 20 74 68 65 20 75 74 | 69 6c 69 74 69 65 73 20 |e the ut|ilities |
|00003960| 75 73 65 64 20 69 6e 20 | 69 6d 70 6c 65 6d 65 6e |used in |implemen|
|00003970| 74 69 6e 67 20 74 68 65 | 20 6d 6f 75 73 65 20 0d |ting the| mouse .|
|00003980| 74 72 61 63 6b 69 6e 67 | 2e 20 7d 0d 0d 0d 7b 20 |tracking|. }...{ |
|00003990| 54 68 69 73 20 72 65 74 | 75 72 6e 73 20 74 68 65 |This ret|urns the|
|000039a0| 20 63 65 6e 74 65 72 20 | 6f 66 20 61 20 67 69 76 | center |of a giv|
|000039b0| 65 6e 20 64 6f 74 2e 20 | 7d 0d 0d 50 52 4f 43 45 |en dot. |}..PROCE|
|000039c0| 44 55 52 45 20 54 44 6f | 74 56 69 65 77 2e 44 6f |DURE TDo|tView.Do|
|000039d0| 74 43 65 6e 74 65 72 28 | 72 6f 77 2c 20 63 6f 6c |tCenter(|row, col|
|000039e0| 3a 20 49 4e 54 45 47 45 | 52 3b 20 0d 09 09 09 09 |: INTEGE|R; .....|
|000039f0| 09 09 09 09 56 41 52 20 | 63 65 6e 74 65 72 3a 20 |....VAR |center: |
|00003a00| 50 6f 69 6e 74 29 3b 0d | 42 45 47 49 4e 0d 09 53 |Point);.|BEGIN..S|
|00003a10| 65 74 50 74 28 63 65 6e | 74 65 72 2c 20 6b 44 6f |etPt(cen|ter, kDo|
|00003a20| 74 53 70 61 63 69 6e 67 | 2a 63 6f 6c 2c 20 6b 44 |tSpacing|*col, kD|
|00003a30| 6f 74 53 70 61 63 69 6e | 67 2a 72 6f 77 29 3b 0d |otSpacin|g*row);.|
|00003a40| 45 4e 44 3b 0d 09 0d 0d | 7b 20 54 68 69 73 20 63 |END;....|{ This c|
|00003a50| 6f 6e 76 65 72 74 73 20 | 74 68 65 20 63 6f 6f 72 |onverts |the coor|
|00003a60| 64 69 6e 61 74 65 73 20 | 6f 66 20 61 20 6c 69 6e |dinates |of a lin|
|00003a70| 65 20 74 6f 20 61 20 70 | 6f 69 6e 74 20 6f 6e 20 |e to a p|oint on |
|00003a80| 74 68 65 20 67 72 69 64 | 2e 20 7d 0d 0d 50 52 4f |the grid|. }..PRO|
|00003a90| 43 45 44 55 52 45 20 54 | 44 6f 74 56 69 65 77 2e |CEDURE T|DotView.|
|00003aa0| 4c 69 6e 65 32 50 74 28 | 64 69 72 65 63 74 69 6f |Line2Pt(|directio|
|00003ab0| 6e 3a 20 4c 69 6e 65 44 | 69 72 3b 20 0d 09 09 09 |n: LineD|ir; ....|
|00003ac0| 09 09 72 6f 77 2c 20 63 | 6f 6c 3a 20 49 4e 54 45 |..row, c|ol: INTE|
|00003ad0| 47 45 52 3b 20 56 41 52 | 09 70 74 3a 20 50 6f 69 |GER; VAR|.pt: Poi|
|00003ae0| 6e 74 29 3b 0d 42 45 47 | 49 4e 0d 7b 20 53 65 74 |nt);.BEG|IN.{ Set|
|00003af0| 20 70 74 20 74 6f 20 63 | 65 6e 74 65 72 20 6f 66 | pt to c|enter of|
|00003b00| 20 67 69 76 65 6e 20 64 | 6f 74 2e 20 7d 0d 09 44 | given d|ot. }..D|
|00003b10| 6f 74 43 65 6e 74 65 72 | 28 72 6f 77 2c 20 63 6f |otCenter|(row, co|
|00003b20| 6c 2c 20 70 74 29 3b 0d | 09 09 0d 7b 20 4f 66 66 |l, pt);.|...{ Off|
|00003b30| 73 65 74 20 69 74 20 74 | 6f 20 62 65 20 6f 6e 20 |set it t|o be on |
|00003b40| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 6c 69 |the requ|ested li|
|00003b50| 6e 65 2e 20 7d 0d 09 49 | 46 20 64 69 72 65 63 74 |ne. }..I|F direct|
|00003b60| 69 6f 6e 20 3d 20 68 4c | 69 6e 65 20 0d 09 54 48 |ion = hL|ine ..TH|
|00003b70| 45 4e 09 70 74 2e 68 20 | 3a 3d 20 70 74 2e 68 20 |EN.pt.h |:= pt.h |
|00003b80| 2b 20 6b 48 61 6c 66 44 | 6f 74 53 69 7a 65 20 2b |+ kHalfD|otSize +|
|00003b90| 20 31 0d 09 45 4c 53 45 | 09 70 74 2e 76 20 3a 3d | 1..ELSE|.pt.v :=|
|00003ba0| 20 70 74 2e 76 20 2b 20 | 6b 48 61 6c 66 44 6f 74 | pt.v + |kHalfDot|
|00003bb0| 53 69 7a 65 20 2b 20 31 | 3b 0d 45 4e 44 3b 0d 0d |Size + 1|;.END;..|
|00003bc0| 0d 7b 20 54 68 69 73 20 | 63 6f 6e 76 65 72 74 73 |.{ This |converts|
|00003bd0| 20 74 68 65 20 73 61 6d | 65 20 63 6f 6f 72 64 69 | the sam|e coordi|
|00003be0| 6e 61 74 65 73 20 74 6f | 20 61 20 72 65 63 74 61 |nates to| a recta|
|00003bf0| 6e 67 6c 65 2e 20 20 54 | 68 69 73 20 69 73 20 0d |ngle. T|his is .|
|00003c00| 75 73 65 64 20 66 6f 72 | 20 68 69 67 68 6c 69 67 |used for| highlig|
|00003c10| 68 74 69 6e 67 20 77 68 | 69 6c 65 20 74 72 61 63 |hting wh|ile trac|
|00003c20| 6b 69 6e 67 20 61 6e 64 | 20 66 6f 72 20 69 6e 76 |king and| for inv|
|00003c30| 61 6c 69 64 61 74 69 6e | 67 20 77 68 65 6e 20 0d |alidatin|g when .|
|00003c40| 74 68 65 20 6c 69 6e 65 | 20 69 73 20 63 68 6f 73 |the line| is chos|
|00003c50| 65 6e 2e 20 7d 0d 09 0d | 50 52 4f 43 45 44 55 52 |en. }...|PROCEDUR|
|00003c60| 45 20 54 44 6f 74 56 69 | 65 77 2e 4c 69 6e 65 32 |E TDotVi|ew.Line2|
|00003c70| 52 65 63 74 28 64 69 72 | 65 63 74 69 6f 6e 3a 20 |Rect(dir|ection: |
|00003c80| 4c 69 6e 65 44 69 72 3b | 20 0d 09 09 09 09 09 72 |LineDir;| ......r|
|00003c90| 6f 77 2c 20 63 6f 6c 3a | 20 49 4e 54 45 47 45 52 |ow, col:| INTEGER|
|00003ca0| 3b 20 56 41 52 20 72 3a | 20 52 65 63 74 29 3b 0d |; VAR r:| Rect);.|
|00003cb0| 09 56 41 52 09 63 65 6e | 74 65 72 3a 09 50 6f 69 |.VAR.cen|ter:.Poi|
|00003cc0| 6e 74 3b 0d 42 45 47 49 | 4e 0d 09 44 6f 74 43 65 |nt;.BEGI|N..DotCe|
|00003cd0| 6e 74 65 72 28 72 6f 77 | 2c 20 63 6f 6c 2c 20 63 |nter(row|, col, c|
|00003ce0| 65 6e 74 65 72 29 3b 0d | 09 09 0d 09 49 46 20 64 |enter);.|....IF d|
|00003cf0| 69 72 65 63 74 69 6f 6e | 20 3d 20 68 4c 69 6e 65 |irection| = hLine|
|00003d00| 20 0d 09 54 48 45 4e 09 | 53 65 74 52 65 63 74 28 | ..THEN.|SetRect(|
|00003d10| 72 2c 20 30 2c 20 2d 6b | 48 61 6c 66 44 6f 74 53 |r, 0, -k|HalfDotS|
|00003d20| 69 7a 65 2c 20 0d 09 09 | 09 09 09 6b 44 6f 74 53 |ize, ...|...kDotS|
|00003d30| 70 61 63 69 6e 67 2b 31 | 2c 20 6b 48 61 6c 66 44 |pacing+1|, kHalfD|
|00003d40| 6f 74 53 69 7a 65 2b 31 | 29 0d 09 45 4c 53 45 20 |otSize+1|)..ELSE |
|00003d50| 09 53 65 74 52 65 63 74 | 28 72 2c 20 2d 6b 48 61 |.SetRect|(r, -kHa|
|00003d60| 6c 66 44 6f 74 53 69 7a | 65 2c 20 30 2c 20 0d 09 |lfDotSiz|e, 0, ..|
|00003d70| 09 09 09 09 6b 48 61 6c | 66 44 6f 74 53 69 7a 65 |....kHal|fDotSize|
|00003d80| 2b 31 2c 20 6b 44 6f 74 | 53 70 61 63 69 6e 67 2b |+1, kDot|Spacing+|
|00003d90| 31 29 3b 0d 09 09 0d 09 | 4f 66 66 73 65 74 52 65 |1);.....|OffsetRe|
|00003da0| 63 74 28 72 2c 20 63 65 | 6e 74 65 72 2e 68 2c 20 |ct(r, ce|nter.h, |
|00003db0| 63 65 6e 74 65 72 2e 76 | 29 3b 0d 45 4e 44 3b 0d |center.v|);.END;.|
|00003dc0| 0d 0d 7b 20 54 68 69 73 | 20 63 6f 6e 76 65 72 74 |..{ This| convert|
|00003dd0| 73 20 61 20 70 6f 69 6e | 74 20 69 6e 20 74 68 65 |s a poin|t in the|
|00003de0| 20 67 72 69 64 20 74 6f | 20 74 68 65 20 63 6f 6f | grid to| the coo|
|00003df0| 72 64 69 6e 61 74 65 73 | 20 6f 66 20 61 20 6c 69 |rdinates| of a li|
|00003e00| 6e 65 2e 20 20 0d 49 74 | 20 72 65 74 75 72 6e 73 |ne. .It| returns|
|00003e10| 20 46 41 4c 53 45 20 69 | 66 20 74 68 65 20 70 6f | FALSE i|f the po|
|00003e20| 69 6e 74 20 69 73 20 6e | 6f 74 20 6f 6e 20 61 20 |int is n|ot on a |
|00003e30| 6c 69 6e 65 2e 20 7d 0d | 09 0d 46 55 4e 43 54 49 |line. }.|..FUNCTI|
|00003e40| 4f 4e 20 20 54 44 6f 74 | 56 69 65 77 2e 50 74 32 |ON TDot|View.Pt2|
|00003e50| 4c 69 6e 65 28 70 74 3a | 20 50 6f 69 6e 74 3b 20 |Line(pt:| Point; |
|00003e60| 0d 09 09 09 09 09 56 41 | 52 20 64 69 72 65 63 74 |......VA|R direct|
|00003e70| 69 6f 6e 3a 20 4c 69 6e | 65 44 69 72 3b 20 0d 09 |ion: Lin|eDir; ..|
|00003e80| 09 09 09 09 56 41 52 20 | 72 6f 77 2c 20 63 6f 6c |....VAR |row, col|
|00003e90| 3a 20 49 4e 54 45 47 45 | 52 29 3a 20 42 4f 4f 4c |: INTEGE|R): BOOL|
|00003ea0| 45 41 4e 3b 0d 09 56 41 | 52 09 6f 6b 3a 09 09 42 |EAN;..VA|R.ok:..B|
|00003eb0| 4f 4f 4c 45 41 4e 3b 0d | 09 09 6d 6f 64 48 3a 09 |OOLEAN;.|..modH:.|
|00003ec0| 49 4e 54 45 47 45 52 3b | 0d 09 09 6d 6f 64 56 3a |INTEGER;|...modV:|
|00003ed0| 09 49 4e 54 45 47 45 52 | 3b 0d 42 45 47 49 4e 0d |.INTEGER|;.BEGIN.|
|00003ee0| 09 6f 6b 20 3a 3d 20 46 | 41 4c 53 45 3b 20 7b 20 |.ok := F|ALSE; { |
|00003ef0| 61 73 73 75 6d 65 20 74 | 68 65 20 77 6f 72 73 74 |assume t|he worst|
|00003f00| 20 7d 0d 09 09 0d 7b 20 | 4f 66 66 73 65 74 20 70 | }....{ |Offset p|
|00003f10| 74 20 62 79 20 73 6c 6f | 70 20 61 6c 6c 6f 77 65 |t by slo|p allowe|
|00003f20| 64 20 62 65 66 6f 72 65 | 20 6c 69 6e 65 20 7d 0d |d before| line }.|
|00003f30| 09 70 74 2e 68 20 3a 3d | 20 70 74 2e 68 20 2b 20 |.pt.h :=| pt.h + |
|00003f40| 6b 46 75 6c 6c 44 6f 74 | 53 69 7a 65 3b 0d 09 70 |kFullDot|Size;..p|
|00003f50| 74 2e 76 20 3a 3d 20 70 | 74 2e 76 20 2b 20 6b 46 |t.v := p|t.v + kF|
|00003f60| 75 6c 6c 44 6f 74 53 69 | 7a 65 3b 0d 09 09 0d 7b |ullDotSi|ze;....{|
|00003f70| 20 44 65 74 65 72 6d 69 | 6e 65 20 76 61 6c 75 65 | Determi|ne value|
|00003f80| 73 20 6f 66 20 72 6f 77 | 20 61 6e 64 20 63 6f 6c |s of row| and col|
|00003f90| 2e 20 7d 0d 09 72 6f 77 | 20 3a 3d 20 70 74 2e 76 |. }..row| := pt.v|
|00003fa0| 20 44 49 56 20 6b 44 6f | 74 53 70 61 63 69 6e 67 | DIV kDo|tSpacing|
|00003fb0| 3b 0d 09 63 6f 6c 20 3a | 3d 20 70 74 2e 68 20 44 |;..col :|= pt.h D|
|00003fc0| 49 56 20 6b 44 6f 74 53 | 70 61 63 69 6e 67 3b 0d |IV kDotS|pacing;.|
|00003fd0| 09 09 0d 09 6f 6b 20 3a | 3d 20 09 28 72 6f 77 20 |....ok :|= .(row |
|00003fe0| 3e 3d 20 31 29 20 41 4e | 44 20 28 72 6f 77 20 3c |>= 1) AN|D (row <|
|00003ff0| 3d 20 6b 44 6f 74 73 50 | 65 72 52 6f 77 29 20 41 |= kDotsP|erRow) A|
|00004000| 4e 44 0d 09 09 09 28 63 | 6f 6c 20 3e 3d 20 31 29 |ND....(c|ol >= 1)|
|00004010| 20 41 4e 44 20 28 63 6f | 6c 20 3c 3d 20 6b 44 6f | AND (co|l <= kDo|
|00004020| 74 73 50 65 72 52 6f 77 | 29 3b 0d 09 09 0d 09 49 |tsPerRow|);.....I|
|00004030| 46 20 6f 6b 20 0d 09 54 | 48 45 4e 20 42 45 47 49 |F ok ..T|HEN BEGI|
|00004040| 4e 20 7b 20 73 6f 20 66 | 61 72 20 73 6f 20 67 6f |N { so f|ar so go|
|00004050| 6f 64 20 7d 0d 09 09 0d | 09 7b 20 20 43 6f 6e 73 |od }....|.{ Cons|
|00004060| 69 64 65 72 20 74 61 6b | 69 6e 67 20 70 74 2e 76 |ider tak|ing pt.v|
|00004070| 20 4d 4f 44 20 6b 44 6f | 74 53 70 61 63 69 6e 67 | MOD kDo|tSpacing|
|00004080| 2e 20 20 49 6e 20 6f 72 | 64 65 72 20 20 74 6f 20 |. In or|der to |
|00004090| 62 65 20 09 6f 6e 20 61 | 20 68 6f 72 69 7a 6f 6e |be .on a| horizon|
|000040a0| 74 61 6c 20 6c 69 6e 65 | 2c 20 74 68 69 73 20 6d |tal line|, this m|
|000040b0| 75 73 74 20 62 65 20 69 | 6e 20 74 68 65 20 72 61 |ust be i|n the ra|
|000040c0| 6e 67 65 20 20 09 30 2e | 2e 32 2a 6b 46 75 6c 6c |nge .0.|.2*kFull|
|000040d0| 44 6f 74 53 69 7a 65 5d | 20 7d 0d 09 09 6d 6f 64 |DotSize]| }...mod|
|000040e0| 48 20 3a 3d 20 70 74 2e | 68 20 4d 4f 44 20 6b 44 |H := pt.|h MOD kD|
|000040f0| 6f 74 53 70 61 63 69 6e | 67 3b 0d 09 09 6d 6f 64 |otSpacin|g;...mod|
|00004100| 56 20 3a 3d 20 70 74 2e | 76 20 4d 4f 44 20 6b 44 |V := pt.|v MOD kD|
|00004110| 6f 74 53 70 61 63 69 6e | 67 3b 0d 09 0d 7b 20 50 |otSpacin|g;...{ P|
|00004120| 69 63 6b 20 74 68 65 20 | 63 6c 6f 73 65 73 74 20 |ick the |closest |
|00004130| 6c 69 6e 65 20 74 6f 20 | 74 68 65 20 70 6f 69 6e |line to |the poin|
|00004140| 74 2e 20 7d 0d 09 09 49 | 46 20 6d 6f 64 48 20 3c |t. }...I|F modH <|
|00004150| 20 6d 6f 64 56 20 0d 09 | 09 54 48 45 4e 20 42 45 | modV ..|.THEN BE|
|00004160| 47 49 4e 0d 09 09 09 64 | 69 72 65 63 74 69 6f 6e |GIN....d|irection|
|00004170| 20 3a 3d 20 76 4c 69 6e | 65 3b 0d 09 09 09 6f 6b | := vLin|e;....ok|
|00004180| 20 3a 3d 20 28 72 6f 77 | 20 3c 20 6b 44 6f 74 73 | := (row| < kDots|
|00004190| 50 65 72 52 6f 77 29 20 | 41 4e 44 20 0d 09 09 09 |PerRow) |AND ....|
|000041a0| 09 28 6d 6f 64 48 20 3c | 3d 20 32 2a 6b 46 75 6c |.(modH <|= 2*kFul|
|000041b0| 6c 44 6f 74 53 69 7a 65 | 29 3b 0d 09 09 45 4e 44 |lDotSize|);...END|
|000041c0| 0d 09 09 45 4c 53 45 20 | 42 45 47 49 4e 0d 09 09 |...ELSE |BEGIN...|
|000041d0| 09 64 69 72 65 63 74 69 | 6f 6e 20 3a 3d 20 68 4c |.directi|on := hL|
|000041e0| 69 6e 65 3b 0d 09 09 09 | 6f 6b 20 3a 3d 20 28 63 |ine;....|ok := (c|
|000041f0| 6f 6c 20 3c 20 6b 44 6f | 74 73 50 65 72 52 6f 77 |ol < kDo|tsPerRow|
|00004200| 29 20 41 4e 44 20 0d 09 | 09 09 09 28 6d 6f 64 56 |) AND ..|...(modV|
|00004210| 20 3c 3d 20 32 2a 6b 46 | 75 6c 6c 44 6f 74 53 69 | <= 2*kF|ullDotSi|
|00004220| 7a 65 29 3b 0d 09 09 45 | 4e 44 3b 0d 09 45 4e 44 |ze);...E|ND;..END|
|00004230| 3b 0d 09 09 09 0d 09 49 | 46 20 4e 4f 54 20 6f 6b |;......I|F NOT ok|
|00004240| 20 0d 09 54 48 45 4e 20 | 42 45 47 49 4e 0d 09 09 | ..THEN |BEGIN...|
|00004250| 72 6f 77 20 3a 3d 20 30 | 3b 0d 09 09 63 6f 6c 20 |row := 0|;...col |
|00004260| 3a 3d 20 30 3b 0d 09 45 | 4e 44 3b 0d 09 09 09 0d |:= 0;..E|ND;.....|
|00004270| 09 50 74 32 4c 69 6e 65 | 20 3a 3d 20 6f 6b 3b 0d |.Pt2Line| := ok;.|
|00004280| 45 4e 44 3b 0d 09 0d 0d | 7b 20 49 66 20 74 68 65 |END;....|{ If the|
|00004290| 20 75 73 65 72 20 61 63 | 74 75 61 6c 6c 79 20 64 | user ac|tually d|
|000042a0| 6f 65 73 20 63 68 6f 6f | 73 65 20 61 20 6c 69 6e |oes choo|se a lin|
|000042b0| 65 2e 20 20 4d 61 63 41 | 70 70 20 77 69 6c 6c 20 |e. MacA|pp will |
|000042c0| 63 61 6c 6c 20 74 68 65 | 20 0d 44 6f 49 74 20 6d |call the| .DoIt m|
|000042d0| 65 74 68 6f 64 20 6f 66 | 20 74 68 65 20 73 61 6d |ethod of| the sam|
|000042e0| 65 20 63 6f 6d 6d 61 6e | 64 20 6f 62 6a 65 63 74 |e comman|d object|
|000042f0| 2e 20 20 49 66 20 74 68 | 65 20 75 73 65 72 20 0d |. If th|e user .|
|00004300| 63 68 6f 6f 73 65 73 20 | 55 6e 64 6f 20 66 72 6f |chooses |Undo fro|
|00004310| 6d 20 74 68 65 20 6d 65 | 6e 75 2c 20 4d 61 63 41 |m the me|nu, MacA|
|00004320| 70 70 20 63 61 6c 6c 73 | 20 74 68 65 20 55 6e 64 |pp calls| the Und|
|00004330| 6f 49 74 20 0d 6d 65 74 | 68 6f 64 2e 20 20 49 66 |oIt .met|hod. If|
|00004340| 20 74 68 65 20 75 73 65 | 72 20 63 68 6f 6f 73 65 | the use|r choose|
|00004350| 73 20 55 6e 64 6f 20 61 | 67 61 69 6e 2c 20 4d 61 |s Undo a|gain, Ma|
|00004360| 63 41 70 70 20 63 61 6c | 6c 73 20 0d 52 65 64 6f |cApp cal|ls .Redo|
|00004370| 49 74 2e 20 7d 0d 09 0d | 50 52 4f 43 45 44 55 52 |It. }...|PROCEDUR|
|00004380| 45 20 54 44 6f 74 43 6f | 6d 6d 61 6e 64 2e 44 6f |E TDotCo|mmand.Do|
|00004390| 49 74 3b 20 4f 56 45 52 | 52 49 44 45 3b 0d 42 45 |It; OVER|RIDE;.BE|
|000043a0| 47 49 4e 0d 09 66 44 6f | 74 44 6f 63 75 6d 65 6e |GIN..fDo|tDocumen|
|000043b0| 74 2e 53 65 74 4c 69 6e | 65 53 74 61 74 65 28 66 |t.SetLin|eState(f|
|000043c0| 44 69 72 65 63 74 69 6f | 6e 2c 20 66 52 6f 77 2c |Directio|n, fRow,|
|000043d0| 20 66 43 6f 6c 2c 20 09 | 09 09 09 09 09 09 09 66 | fCol, .|.......f|
|000043e0| 50 6c 61 79 65 72 31 2c | 20 54 52 55 45 29 3b 0d |Player1,| TRUE);.|
|000043f0| 45 4e 44 3b 0d 0d 50 52 | 4f 43 45 44 55 52 45 20 |END;..PR|OCEDURE |
|00004400| 54 44 6f 74 43 6f 6d 6d | 61 6e 64 2e 55 6e 64 6f |TDotComm|and.Undo|
|00004410| 49 74 3b 20 4f 56 45 52 | 52 49 44 45 3b 0d 42 45 |It; OVER|RIDE;.BE|
|00004420| 47 49 4e 0d 09 66 44 6f | 74 44 6f 63 75 6d 65 6e |GIN..fDo|tDocumen|
|00004430| 74 2e 53 65 74 4c 69 6e | 65 53 74 61 74 65 28 66 |t.SetLin|eState(f|
|00004440| 44 69 72 65 63 74 69 6f | 6e 2c 20 66 52 6f 77 2c |Directio|n, fRow,|
|00004450| 20 66 43 6f 6c 2c 20 09 | 09 09 09 09 09 09 09 66 | fCol, .|.......f|
|00004460| 50 6c 61 79 65 72 31 2c | 20 46 41 4c 53 45 29 3b |Player1,| FALSE);|
|00004470| 0d 45 4e 44 3b 0d 09 0d | 50 52 4f 43 45 44 55 52 |.END;...|PROCEDUR|
|00004480| 45 20 54 44 6f 74 43 6f | 6d 6d 61 6e 64 2e 52 65 |E TDotCo|mmand.Re|
|00004490| 64 6f 49 74 3b 20 4f 56 | 45 52 52 49 44 45 3b 0d |doIt; OV|ERRIDE;.|
|000044a0| 42 45 47 49 4e 0d 09 66 | 44 6f 74 44 6f 63 75 6d |BEGIN..f|DotDocum|
|000044b0| 65 6e 74 2e 53 65 74 4c | 69 6e 65 53 74 61 74 65 |ent.SetL|ineState|
|000044c0| 28 66 44 69 72 65 63 74 | 69 6f 6e 2c 20 66 52 6f |(fDirect|ion, fRo|
|000044d0| 77 2c 20 66 43 6f 6c 2c | 20 09 09 09 09 09 09 09 |w, fCol,| .......|
|000044e0| 09 66 50 6c 61 79 65 72 | 31 2c 20 54 52 55 45 29 |.fPlayer|1, TRUE)|
|000044f0| 3b 0d 45 4e 44 3b 0d 09 | 0d 7b 20 54 68 69 73 20 |;.END;..|.{ This |
|00004500| 69 73 20 74 68 65 20 6d | 65 74 68 6f 64 20 66 6f |is the m|ethod fo|
|00004510| 72 20 63 68 61 6e 67 69 | 6e 67 20 74 68 65 20 73 |r changi|ng the s|
|00004520| 74 61 74 65 20 6f 66 20 | 61 20 6c 69 6e 65 2e 20 |tate of |a line. |
|00004530| 7d 0d 0d 50 52 4f 43 45 | 44 55 52 45 20 54 44 6f |}..PROCE|DURE TDo|
|00004540| 74 44 6f 63 75 6d 65 6e | 74 2e 53 65 74 4c 69 6e |tDocumen|t.SetLin|
|00004550| 65 53 74 61 74 65 28 64 | 69 72 65 63 74 69 6f 6e |eState(d|irection|
|00004560| 3a 20 4c 69 6e 65 44 69 | 72 3b 20 09 09 09 09 09 |: LineDi|r; .....|
|00004570| 72 6f 77 2c 20 63 6f 6c | 3a 20 49 4e 54 45 47 45 |row, col|: INTEGE|
|00004580| 52 3b 20 0d 09 09 09 09 | 09 66 6f 72 50 6c 61 79 |R; .....|.forPlay|
|00004590| 65 72 31 2c 20 6e 65 77 | 53 74 61 74 65 3a 20 42 |er1, new|State: B|
|000045a0| 4f 4f 4c 45 41 4e 29 3b | 0d 09 56 41 52 09 6f 6c |OOLEAN);|..VAR.ol|
|000045b0| 64 53 74 61 74 65 3a 09 | 42 4f 4f 4c 45 41 4e 3b |dState:.|BOOLEAN;|
|000045c0| 0d 42 45 47 49 4e 0d 09 | 6f 6c 64 53 74 61 74 65 |.BEGIN..|oldState|
|000045d0| 20 3a 3d 20 47 65 74 4c | 69 6e 65 53 74 61 74 65 | := GetL|ineState|
|000045e0| 28 64 69 72 65 63 74 69 | 6f 6e 2c 20 72 6f 77 2c |(directi|on, row,|
|000045f0| 20 63 6f 6c 29 3b 0d 09 | 49 46 20 6f 6c 64 53 74 | col);..|IF oldSt|
|00004600| 61 74 65 20 3c 3e 20 6e | 65 77 53 74 61 74 65 20 |ate <> n|ewState |
|00004610| 0d 09 54 48 45 4e 20 42 | 45 47 49 4e 20 7b 20 74 |..THEN B|EGIN { t|
|00004620| 68 65 20 73 74 61 74 65 | 20 61 63 74 75 61 6c 6c |he state| actuall|
|00004630| 79 20 63 68 61 6e 67 65 | 64 20 7d 0d 09 09 0d 09 |y change|d }.....|
|00004640| 7b 20 6d 6f 64 69 66 79 | 20 74 68 65 20 64 6f 63 |{ modify| the doc|
|00004650| 75 6d 65 6e 74 20 64 61 | 74 61 20 73 74 72 75 63 |ument da|ta struc|
|00004660| 74 75 72 65 73 20 7d 0d | 09 09 66 4c 69 6e 65 73 |tures }.|..fLines|
|00004670| 5b 64 69 72 65 63 74 69 | 6f 6e 2c 20 72 6f 77 2c |[directi|on, row,|
|00004680| 20 63 6f 6c 5d 20 3a 3d | 20 6e 65 77 53 74 61 74 | col] :=| newStat|
|00004690| 65 3b 0d 09 09 09 0d 09 | 7b 20 6d 61 6b 65 20 73 |e;......|{ make s|
|000046a0| 75 72 65 20 74 68 65 20 | 6c 69 6e 65 20 69 73 20 |ure the |line is |
|000046b0| 72 65 64 72 61 77 6e 20 | 7d 0d 09 09 66 44 6f 74 |redrawn |}...fDot|
|000046c0| 56 69 65 77 2e 49 6e 76 | 61 6c 4c 69 6e 65 28 64 |View.Inv|alLine(d|
|000046d0| 69 72 65 63 74 69 6f 6e | 2c 20 72 6f 77 2c 20 63 |irection|, row, c|
|000046e0| 6f 6c 29 3b 0d 09 09 09 | 0d 09 7b 20 63 68 61 6e |ol);....|..{ chan|
|000046f0| 67 65 20 74 68 65 20 73 | 74 61 74 65 20 6f 66 20 |ge the s|tate of |
|00004700| 74 68 65 20 62 6f 78 20 | 74 6f 20 74 68 65 20 72 |the box |to the r|
|00004710| 69 67 68 74 20 6f 72 20 | 75 6e 64 65 72 20 74 68 |ight or |under th|
|00004720| 65 20 6c 69 6e 65 20 09 | 09 09 09 09 09 09 09 09 |e line .|........|
|00004730| 09 28 69 66 20 61 6e 79 | 29 20 7d 0d 09 09 49 46 |.(if any|) }...IF|
|00004740| 20 28 72 6f 77 20 3c 20 | 6b 44 6f 74 73 50 65 72 | (row < |kDotsPer|
|00004750| 52 6f 77 29 20 41 4e 44 | 20 28 63 6f 6c 20 3c 20 |Row) AND| (col < |
|00004760| 6b 44 6f 74 73 50 65 72 | 52 6f 77 29 20 0d 09 09 |kDotsPer|Row) ...|
|00004770| 54 48 45 4e 09 43 68 61 | 6e 67 65 42 6f 78 53 74 |THEN.Cha|ngeBoxSt|
|00004780| 61 74 65 28 72 6f 77 2c | 20 63 6f 6c 2c 20 0d 09 |ate(row,| col, ..|
|00004790| 09 09 09 09 09 09 66 6f | 72 50 6c 61 79 65 72 31 |......fo|rPlayer1|
|000047a0| 2c 20 6e 65 77 53 74 61 | 74 65 29 3b 0d 09 09 09 |, newSta|te);....|
|000047b0| 09 0d 09 09 7b 20 63 68 | 61 6e 67 65 20 74 68 65 |....{ ch|ange the|
|000047c0| 20 73 74 61 74 65 20 6f | 66 20 74 68 65 20 62 6f | state o|f the bo|
|000047d0| 78 20 74 6f 20 74 68 65 | 20 6c 65 66 74 20 6f 72 |x to the| left or|
|000047e0| 20 61 62 6f 76 65 20 20 | 74 68 65 20 09 09 09 09 | above |the ....|
|000047f0| 09 09 09 09 09 6c 69 6e | 65 20 28 69 66 20 61 6e |.....lin|e (if an|
|00004800| 79 29 20 7d 0d 09 09 49 | 46 20 64 69 72 65 63 74 |y) }...I|F direct|
|00004810| 69 6f 6e 20 3d 20 68 4c | 69 6e 65 20 0d 09 09 54 |ion = hL|ine ...T|
|00004820| 48 45 4e 20 42 45 47 49 | 4e 0d 09 09 09 49 46 20 |HEN BEGI|N....IF |
|00004830| 72 6f 77 20 3e 20 31 20 | 0d 09 09 09 54 48 45 4e |row > 1 |....THEN|
|00004840| 09 43 68 61 6e 67 65 42 | 6f 78 53 74 61 74 65 28 |.ChangeB|oxState(|
|00004850| 72 6f 77 2d 31 2c 20 63 | 6f 6c 2c 20 09 09 09 09 |row-1, c|ol, ....|
|00004860| 09 09 09 66 6f 72 50 6c | 61 79 65 72 31 2c 20 6e |...forPl|ayer1, n|
|00004870| 65 77 53 74 61 74 65 29 | 3b 0d 09 09 45 4e 44 0d |ewState)|;...END.|
|00004880| 09 09 45 4c 53 45 20 42 | 45 47 49 4e 0d 09 09 09 |..ELSE B|EGIN....|
|00004890| 49 46 20 63 6f 6c 20 3e | 20 31 20 0d 09 09 09 54 |IF col >| 1 ....T|
|000048a0| 48 45 4e 09 43 68 61 6e | 67 65 42 6f 78 53 74 61 |HEN.Chan|geBoxSta|
|000048b0| 74 65 28 72 6f 77 2c 20 | 63 6f 6c 2d 31 2c 20 09 |te(row, |col-1, .|
|000048c0| 09 09 09 09 09 09 66 6f | 72 50 6c 61 79 65 72 31 |......fo|rPlayer1|
|000048d0| 2c 20 6e 65 77 53 74 61 | 74 65 29 3b 0d 09 09 45 |, newSta|te);...E|
|000048e0| 4e 44 3b 0d 09 45 4e 44 | 3b 0d 09 09 0d 7b 20 6c |ND;..END|;....{ l|
|000048f0| 65 74 20 74 68 65 20 6f | 74 68 65 72 20 70 6c 61 |et the o|ther pla|
|00004900| 79 65 72 20 68 61 76 65 | 20 61 20 74 75 72 6e 3b |yer have| a turn;|
|00004910| 20 61 6e 64 20 6d 61 6b | 65 20 73 75 72 65 20 74 | and mak|e sure t|
|00004920| 68 65 20 73 63 6f 72 65 | 20 0d 76 69 65 77 20 73 |he score| .view s|
|00004930| 68 6f 77 73 20 77 68 6f | 73 65 20 74 75 72 6e 20 |hows who|se turn |
|00004940| 69 74 20 69 73 20 7d 0d | 09 66 50 6c 61 79 65 72 |it is }.|.fPlayer|
|00004950| 31 54 75 72 6e 20 3a 3d | 20 4e 4f 54 20 66 50 6c |1Turn :=| NOT fPl|
|00004960| 61 79 65 72 31 54 75 72 | 6e 3b 0d 09 66 53 63 6f |ayer1Tur|n;..fSco|
|00004970| 72 65 56 69 65 77 2e 53 | 65 74 54 75 72 6e 28 66 |reView.S|etTurn(f|
|00004980| 50 6c 61 79 65 72 31 54 | 75 72 6e 29 3b 0d 45 4e |Player1T|urn);.EN|
|00004990| 44 3b 0d 09 0d 0d 7b 20 | 54 68 69 73 20 63 68 61 |D;....{ |This cha|
|000049a0| 6e 67 65 73 20 74 68 65 | 20 73 74 61 74 65 20 6f |nges the| state o|
|000049b0| 66 20 61 20 62 6f 78 2e | 20 7d 0d 0d 09 50 52 4f |f a box.| }...PRO|
|000049c0| 43 45 44 55 52 45 20 54 | 44 6f 74 44 6f 63 75 6d |CEDURE T|DotDocum|
|000049d0| 65 6e 74 2e 43 68 61 6e | 67 65 42 6f 78 53 74 61 |ent.Chan|geBoxSta|
|000049e0| 74 65 28 0d 09 09 09 09 | 09 72 6f 77 2c 20 63 6f |te(.....|.row, co|
|000049f0| 6c 3a 20 49 4e 54 45 47 | 45 52 3b 20 20 0d 09 09 |l: INTEG|ER; ...|
|00004a00| 09 09 09 66 6f 72 50 6c | 61 79 65 72 31 2c 20 61 |...forPl|ayer1, a|
|00004a10| 64 64 69 6e 67 4c 69 6e | 65 3a 20 42 4f 4f 4c 45 |ddingLin|e: BOOLE|
|00004a20| 41 4e 29 3b 0d 09 09 56 | 41 52 09 62 6f 78 53 74 |AN);...V|AR.boxSt|
|00004a30| 61 74 65 3a 09 42 6f 78 | 53 74 61 74 65 3b 0d 09 |ate:.Box|State;..|
|00004a40| 09 09 64 65 6c 74 61 3a | 09 09 49 4e 54 45 47 45 |..delta:|..INTEGE|
|00004a50| 52 3b 0d 09 42 45 47 49 | 4e 0d 09 7b 20 67 65 74 |R;..BEGI|N..{ get|
|00004a60| 20 74 68 65 20 6f 6c 64 | 20 73 74 61 74 65 20 7d | the old| state }|
|00004a70| 0d 09 09 62 6f 78 53 74 | 61 74 65 20 3a 3d 20 66 |...boxSt|ate := f|
|00004a80| 42 6f 78 65 73 5b 72 6f | 77 2c 20 63 6f 6c 5d 3b |Boxes[ro|w, col];|
|00004a90| 0d 09 09 0d 09 09 49 46 | 20 61 64 64 69 6e 67 4c |......IF| addingL|
|00004aa0| 69 6e 65 20 0d 09 09 54 | 48 45 4e 20 42 45 47 49 |ine ...T|HEN BEGI|
|00004ab0| 4e 0d 09 09 09 49 46 20 | 62 6f 78 53 74 61 74 65 |N....IF |boxState|
|00004ac0| 20 3c 20 6b 42 6f 78 50 | 6c 61 79 65 72 31 20 0d | < kBoxP|layer1 .|
|00004ad0| 09 09 09 54 48 45 4e 20 | 42 45 47 49 4e 09 0d 09 |...THEN |BEGIN...|
|00004ae0| 09 09 7b 20 74 68 65 20 | 62 6f 78 20 69 73 20 6e |..{ the |box is n|
|00004af0| 6f 74 20 61 6c 72 65 61 | 64 79 20 63 6f 6d 70 6c |ot alrea|dy compl|
|00004b00| 65 74 65 64 20 7d 0d 09 | 09 09 09 62 6f 78 53 74 |eted }..|...boxSt|
|00004b10| 61 74 65 20 3a 3d 20 62 | 6f 78 53 74 61 74 65 20 |ate := b|oxState |
|00004b20| 2b 20 31 3b 0d 09 09 09 | 09 0d 09 09 09 09 49 46 |+ 1;....|......IF|
|00004b30| 20 62 6f 78 53 74 61 74 | 65 20 3d 20 6b 42 6f 78 | boxStat|e = kBox|
|00004b40| 50 6c 61 79 65 72 31 20 | 0d 09 09 09 09 54 48 45 |Player1 |.....THE|
|00004b50| 4e 20 42 45 47 49 4e 0d | 09 09 09 09 7b 20 69 66 |N BEGIN.|....{ if|
|00004b60| 20 74 68 69 73 20 77 61 | 73 20 70 6c 61 79 65 72 | this wa|s player|
|00004b70| 20 32 27 73 20 74 75 72 | 6e 2c 20 0d 09 09 09 09 | 2's tur|n, .....|
|00004b80| 09 09 09 09 09 72 65 63 | 6f 72 64 20 74 68 61 74 |.....rec|ord that|
|00004b90| 20 66 61 63 74 20 7d 0d | 09 09 09 09 09 49 46 20 | fact }.|.....IF |
|00004ba0| 4e 4f 54 20 66 6f 72 50 | 6c 61 79 65 72 31 20 0d |NOT forP|layer1 .|
|00004bb0| 09 09 09 09 09 54 48 45 | 4e 09 62 6f 78 53 74 61 |.....THE|N.boxSta|
|00004bc0| 74 65 20 3a 3d 20 6b 42 | 6f 78 50 6c 61 79 65 72 |te := kB|oxPlayer|
|00004bd0| 32 3b 0d 0d 09 09 09 09 | 7b 20 74 68 65 20 62 6f |2;......|{ the bo|
|00004be0| 78 20 77 61 73 20 6a 75 | 73 74 20 63 6f 6d 70 6c |x was ju|st compl|
|00004bf0| 65 74 65 64 2c 20 0d 09 | 09 09 09 09 09 09 09 73 |eted, ..|.......s|
|00004c00| 6f 20 63 68 61 6e 67 65 | 20 74 68 65 20 62 6f 78 |o change| the box|
|00004c10| 20 2e 2e 2e 20 7d 0d 09 | 09 09 09 09 66 44 6f 74 | ... }..|....fDot|
|00004c20| 56 69 65 77 2e 49 6e 76 | 61 6c 42 6f 78 28 72 6f |View.Inv|alBox(ro|
|00004c30| 77 2c 20 63 6f 6c 29 3b | 0d 09 09 09 09 09 0d 09 |w, col);|........|
|00004c40| 09 09 09 7b 20 2e 2e 2e | 20 61 6e 64 20 73 63 6f |...{ ...| and sco|
|00004c50| 72 65 20 7d 0d 09 09 09 | 09 09 66 53 63 6f 72 65 |re }....|..fScore|
|00004c60| 56 69 65 77 2e 49 6e 76 | 61 6c 53 63 6f 72 65 28 |View.Inv|alScore(|
|00004c70| 66 6f 72 50 6c 61 79 65 | 72 31 29 3b 0d 09 09 09 |forPlaye|r1);....|
|00004c80| 09 45 4e 44 3b 20 0d 09 | 09 09 45 4e 44 3b 0d 09 |.END; ..|..END;..|
|00004c90| 09 45 4e 44 0d 09 09 45 | 4c 53 45 20 42 45 47 49 |.END...E|LSE BEGI|
|00004ca0| 4e 20 7b 20 72 65 6d 6f | 76 69 6e 67 20 61 20 6c |N { remo|ving a l|
|00004cb0| 69 6e 65 7d 0d 09 09 09 | 49 46 20 62 6f 78 53 74 |ine}....|IF boxSt|
|00004cc0| 61 74 65 20 3e 3d 20 6b | 42 6f 78 50 6c 61 79 65 |ate >= k|BoxPlaye|
|00004cd0| 72 31 20 0d 09 09 09 54 | 48 45 4e 20 42 45 47 49 |r1 ....T|HEN BEGI|
|00004ce0| 4e 0d 09 09 09 7b 20 75 | 73 65 64 20 74 6f 20 62 |N....{ u|sed to b|
|00004cf0| 65 20 63 6f 6d 70 6c 65 | 74 65 64 2c 20 0d 09 09 |e comple|ted, ...|
|00004d00| 09 09 09 09 6d 61 6b 65 | 20 73 75 72 65 20 62 6f |....make| sure bo|
|00004d10| 78 20 69 73 20 72 65 64 | 72 61 77 6e 20 2e 2e 2e |x is red|rawn ...|
|00004d20| 20 7d 0d 09 09 09 09 66 | 44 6f 74 56 69 65 77 2e | }.....f|DotView.|
|00004d30| 49 6e 76 61 6c 42 6f 78 | 28 72 6f 77 2c 20 63 6f |InvalBox|(row, co|
|00004d40| 6c 29 3b 0d 09 09 09 09 | 0d 09 09 09 7b 20 2e 2e |l);.....|....{ ..|
|00004d50| 2e 20 61 6e 64 20 73 63 | 6f 72 65 20 69 73 20 75 |. and sc|ore is u|
|00004d60| 70 64 61 74 65 64 20 7d | 0d 09 09 09 09 66 53 63 |pdated }|.....fSc|
|00004d70| 6f 72 65 56 69 65 77 2e | 49 6e 76 61 6c 53 63 6f |oreView.|InvalSco|
|00004d80| 72 65 28 66 6f 72 50 6c | 61 79 65 72 31 29 3b 0d |re(forPl|ayer1);.|
|00004d90| 09 09 09 45 4e 44 3b 0d | 09 09 09 0d 09 09 7b 20 |...END;.|......{ |
|00004da0| 75 70 64 61 74 65 20 74 | 68 65 20 73 74 61 74 65 |update t|he state|
|00004db0| 20 6f 66 20 74 68 65 20 | 62 6f 78 20 61 70 70 72 | of the |box appr|
|00004dc0| 6f 70 72 69 61 74 65 6c | 79 20 7d 0d 09 09 09 49 |opriatel|y }....I|
|00004dd0| 46 20 62 6f 78 53 74 61 | 74 65 20 3d 20 6b 42 6f |F boxSta|te = kBo|
|00004de0| 78 50 6c 61 79 65 72 32 | 20 0d 09 09 09 54 48 45 |xPlayer2| ....THE|
|00004df0| 4e 09 62 6f 78 53 74 61 | 74 65 20 3a 3d 20 33 0d |N.boxSta|te := 3.|
|00004e00| 09 09 09 45 4c 53 45 09 | 62 6f 78 53 74 61 74 65 |...ELSE.|boxState|
|00004e10| 20 3a 3d 20 62 6f 78 53 | 74 61 74 65 20 2d 20 31 | := boxS|tate - 1|
|00004e20| 3b 0d 09 09 45 4e 44 3b | 0d 09 09 0d 09 7b 20 66 |;...END;|.....{ f|
|00004e30| 69 6e 61 6c 6c 79 20 63 | 68 61 6e 67 65 20 74 68 |inally c|hange th|
|00004e40| 65 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |e data s|tructure|
|00004e50| 20 7d 0d 09 09 66 42 6f | 78 65 73 5b 72 6f 77 2c | }...fBo|xes[row,|
|00004e60| 20 63 6f 6c 5d 20 3a 3d | 20 62 6f 78 53 74 61 74 | col] :=| boxStat|
|00004e70| 65 3b 0d 45 4e 44 3b 0d | 09 0d 0d 7b 20 54 68 65 |e;.END;.|...{ The|
|00004e80| 73 65 20 34 20 6d 65 74 | 68 6f 64 73 20 6d 61 6b |se 4 met|hods mak|
|00004e90| 65 20 73 75 72 65 20 74 | 68 61 74 20 74 68 65 20 |e sure t|hat the |
|00004ea0| 76 69 65 77 73 20 61 72 | 65 20 75 70 64 61 74 65 |views ar|e update|
|00004eb0| 64 20 7d 0d 0d 50 52 4f | 43 45 44 55 52 45 20 54 |d }..PRO|CEDURE T|
|00004ec0| 44 6f 74 56 69 65 77 2e | 49 6e 76 61 6c 4c 69 6e |DotView.|InvalLin|
|00004ed0| 65 28 64 69 72 65 63 74 | 69 6f 6e 3a 20 4c 69 6e |e(direct|ion: Lin|
|00004ee0| 65 44 69 72 3b 20 0d 09 | 09 09 09 09 09 09 09 72 |eDir; ..|.......r|
|00004ef0| 6f 77 2c 20 63 6f 6c 3a | 20 49 4e 54 45 47 45 52 |ow, col:| INTEGER|
|00004f00| 29 3b 0d 09 56 41 52 09 | 72 3a 09 52 65 63 74 3b |);..VAR.|r:.Rect;|
|00004f10| 0d 42 45 47 49 4e 0d 09 | 4c 69 6e 65 32 52 65 63 |.BEGIN..|Line2Rec|
|00004f20| 74 28 64 69 72 65 63 74 | 69 6f 6e 2c 20 72 6f 77 |t(direct|ion, row|
|00004f30| 2c 20 63 6f 6c 2c 20 72 | 29 3b 0d 09 49 6e 76 61 |, col, r|);..Inva|
|00004f40| 6c 69 64 52 65 63 74 28 | 72 29 3b 0d 45 4e 44 3b |lidRect(|r);.END;|
|00004f50| 0d 09 0d 09 0d 50 52 4f | 43 45 44 55 52 45 20 54 |.....PRO|CEDURE T|
|00004f60| 44 6f 74 56 69 65 77 2e | 49 6e 76 61 6c 42 6f 78 |DotView.|InvalBox|
|00004f70| 28 72 6f 77 2c 20 63 6f | 6c 3a 20 49 4e 54 45 47 |(row, co|l: INTEG|
|00004f80| 45 52 29 3b 0d 09 56 41 | 52 09 72 3a 09 52 65 63 |ER);..VA|R.r:.Rec|
|00004f90| 74 3b 0d 42 45 47 49 4e | 0d 09 42 6f 78 32 52 65 |t;.BEGIN|..Box2Re|
|00004fa0| 63 74 28 72 6f 77 2c 20 | 63 6f 6c 2c 20 72 29 3b |ct(row, |col, r);|
|00004fb0| 0d 09 49 6e 76 61 6c 69 | 64 52 65 63 74 28 72 29 |..Invali|dRect(r)|
|00004fc0| 3b 0d 45 4e 44 3b 0d 09 | 0d 0d 50 52 4f 43 45 44 |;.END;..|..PROCED|
|00004fd0| 55 52 45 20 54 53 63 6f | 72 65 56 69 65 77 2e 49 |URE TSco|reView.I|
|00004fe0| 6e 76 61 6c 53 63 6f 72 | 65 28 0d 09 09 09 09 09 |nvalScor|e(......|
|00004ff0| 09 66 6f 72 50 6c 61 79 | 65 72 31 3a 20 42 4f 4f |.forPlay|er1: BOO|
|00005000| 4c 45 41 4e 29 3b 0d 09 | 56 41 52 09 72 3a 09 52 |LEAN);..|VAR.r:.R|
|00005010| 65 63 74 3b 0d 42 45 47 | 49 4e 0d 09 47 65 74 50 |ect;.BEG|IN..GetP|
|00005020| 6c 61 79 65 72 52 65 63 | 74 28 66 6f 72 50 6c 61 |layerRec|t(forPla|
|00005030| 79 65 72 31 2c 20 72 29 | 3b 0d 09 49 6e 76 61 6c |yer1, r)|;..Inval|
|00005040| 69 64 52 65 63 74 28 72 | 29 3b 0d 45 4e 44 3b 0d |idRect(r|);.END;.|
|00005050| 09 0d 0d 50 52 4f 43 45 | 44 55 52 45 20 54 53 63 |...PROCE|DURE TSc|
|00005060| 6f 72 65 56 69 65 77 2e | 53 65 74 54 75 72 6e 28 |oreView.|SetTurn(|
|00005070| 70 6c 61 79 65 72 31 54 | 75 72 6e 3a 20 42 4f 4f |player1T|urn: BOO|
|00005080| 4c 45 41 4e 29 3b 0d 09 | 56 41 52 09 72 3a 09 52 |LEAN);..|VAR.r:.R|
|00005090| 65 63 74 3b 0d 42 45 47 | 49 4e 0d 7b 20 54 68 69 |ect;.BEG|IN.{ Thi|
|000050a0| 73 20 6d 65 74 68 6f 64 | 20 61 63 74 75 61 6c 6c |s method| actuall|
|000050b0| 79 20 64 72 61 77 73 20 | 6f 6e 20 74 68 65 20 73 |y draws |on the s|
|000050c0| 63 72 65 65 6e 2c 20 73 | 69 6e 63 65 20 69 74 20 |creen, s|ince it |
|000050d0| 69 73 20 65 61 73 79 0d | 09 09 09 09 09 09 74 6f |is easy.|......to|
|000050e0| 20 75 70 64 61 74 65 20 | 74 68 65 20 74 75 72 6e | update |the turn|
|000050f0| 20 69 6e 64 69 63 61 74 | 69 6f 6e 20 7d 0d 09 09 | indicat|ion }...|
|00005100| 09 09 0d 09 49 46 20 70 | 6c 61 79 65 72 31 54 75 |....IF p|layer1Tu|
|00005110| 72 6e 20 3c 3e 20 66 50 | 6c 61 79 65 72 31 54 75 |rn <> fP|layer1Tu|
|00005120| 72 6e 20 0d 09 54 48 45 | 4e 20 42 45 47 49 4e 0d |rn ..THE|N BEGIN.|
|00005130| 09 7b 20 54 68 69 73 20 | 73 65 74 73 20 75 70 20 |.{ This |sets up |
|00005140| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 6f 72 74 |the curr|ent port|
|00005150| 20 73 6f 20 74 68 61 74 | 20 77 65 20 63 61 6e 20 | so that| we can |
|00005160| 64 72 61 77 20 69 6e 20 | 74 68 65 0d 09 09 09 09 |draw in |the.....|
|00005170| 09 09 09 09 09 73 63 6f | 72 65 20 76 69 65 77 2e |.....sco|re view.|
|00005180| 20 7d 0d 09 09 66 46 72 | 61 6d 65 2e 46 6f 63 75 | }...fFr|ame.Focu|
|00005190| 73 3b 0d 09 09 09 0d 09 | 09 47 65 74 50 6c 61 79 |s;......|.GetPlay|
|000051a0| 65 72 52 65 63 74 28 66 | 50 6c 61 79 65 72 31 54 |erRect(f|Player1T|
|000051b0| 75 72 6e 2c 20 72 29 3b | 0d 09 09 49 6e 76 65 72 |urn, r);|...Inver|
|000051c0| 74 52 65 63 74 28 72 29 | 3b 0d 09 09 47 65 74 50 |tRect(r)|;...GetP|
|000051d0| 6c 61 79 65 72 52 65 63 | 74 28 70 6c 61 79 65 72 |layerRec|t(player|
|000051e0| 31 54 75 72 6e 2c 20 72 | 29 3b 0d 09 09 49 6e 76 |1Turn, r|);...Inv|
|000051f0| 65 72 74 52 65 63 74 28 | 72 29 3b 0d 09 09 09 0d |ertRect(|r);.....|
|00005200| 09 09 66 50 6c 61 79 65 | 72 31 54 75 72 6e 20 3a |..fPlaye|r1Turn :|
|00005210| 3d 20 70 6c 61 79 65 72 | 31 54 75 72 6e 3b 0d 09 |= player|1Turn;..|
|00005220| 09 45 4e 44 3b 0d 45 4e | 44 3b 0d 09 0d 0d 7b 20 |.END;.EN|D;....{ |
|00005230| 4c 61 73 74 20 62 75 74 | 20 6e 6f 74 20 6c 65 61 |Last but| not lea|
|00005240| 73 74 2c 20 68 65 72 65 | 20 61 72 65 20 74 68 65 |st, here| are the|
|00005250| 20 32 20 6d 65 74 68 6f | 64 73 20 6e 65 65 64 65 | 2 metho|ds neede|
|00005260| 64 20 69 6e 20 6f 72 64 | 65 72 20 74 6f 20 0d 73 |d in ord|er to .s|
|00005270| 61 76 65 20 67 61 6d 65 | 73 20 6f 6e 20 74 68 65 |ave game|s on the|
|00005280| 20 64 69 73 6b 2e 20 7d | 0d 0d 7b 20 54 68 69 73 | disk. }|..{ This|
|00005290| 20 63 6f 6d 70 75 74 65 | 73 20 74 68 65 20 64 69 | compute|s the di|
|000052a0| 73 6b 20 73 70 61 63 65 | 20 72 65 71 75 69 72 65 |sk space| require|
|000052b0| 64 20 62 79 20 74 68 65 | 20 64 6f 63 75 6d 65 6e |d by the| documen|
|000052c0| 74 2e 20 20 0d 4d 61 63 | 41 70 70 20 77 69 6c 6c |t. .Mac|App will|
|000052d0| 20 6d 61 6b 65 20 73 75 | 72 65 20 74 68 61 74 20 | make su|re that |
|000052e0| 74 68 65 72 65 20 69 73 | 20 65 6e 6f 75 67 68 20 |there is| enough |
|000052f0| 64 69 73 6b 20 73 70 61 | 63 65 20 0d 61 76 61 69 |disk spa|ce .avai|
|00005300| 6c 61 62 6c 65 20 74 6f | 20 73 61 76 65 20 61 20 |lable to| save a |
|00005310| 62 72 61 6e 64 20 6e 65 | 77 20 63 6f 70 79 20 6f |brand ne|w copy o|
|00005320| 66 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 2c 20 |f the do|cument, |
|00005330| 62 65 66 6f 72 65 20 0d | 64 65 6c 65 74 69 6e 67 |before .|deleting|
|00005340| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 76 65 | the ori|ginal ve|
|00005350| 72 73 69 6f 6e 2e 20 7d | 0d 09 0d 50 52 4f 43 45 |rsion. }|...PROCE|
|00005360| 44 55 52 45 20 54 44 6f | 74 44 6f 63 75 6d 65 6e |DURE TDo|tDocumen|
|00005370| 74 2e 44 6f 4e 65 65 64 | 44 69 73 6b 53 70 61 63 |t.DoNeed|DiskSpac|
|00005380| 65 28 0d 09 09 09 09 56 | 41 52 20 64 61 74 61 46 |e(.....V|AR dataF|
|00005390| 6f 72 6b 42 79 74 65 73 | 2c 20 20 0d 09 09 09 09 |orkBytes|, .....|
|000053a0| 72 73 72 63 46 6f 72 6b | 42 79 74 65 73 3a 20 4c |rsrcFork|Bytes: L|
|000053b0| 4f 4e 47 49 4e 54 29 3b | 20 4f 56 45 52 52 49 44 |ONGINT);| OVERRID|
|000053c0| 45 3b 0d 42 45 47 49 4e | 0d 09 49 4e 48 45 52 49 |E;.BEGIN|..INHERI|
|000053d0| 54 45 44 20 44 6f 4e 65 | 65 64 44 69 73 6b 53 70 |TED DoNe|edDiskSp|
|000053e0| 61 63 65 28 0d 09 09 09 | 09 09 09 64 61 74 61 46 |ace(....|...dataF|
|000053f0| 6f 72 6b 42 79 74 65 73 | 2c 20 72 73 72 63 46 6f |orkBytes|, rsrcFo|
|00005400| 72 6b 42 79 74 65 73 29 | 3b 0d 09 64 61 74 61 46 |rkBytes)|;..dataF|
|00005410| 6f 72 6b 42 79 74 65 73 | 20 3a 3d 20 09 53 49 5a |orkBytes| := .SIZ|
|00005420| 45 4f 46 28 4c 69 6e 65 | 41 72 72 61 79 29 20 2b |EOF(Line|Array) +|
|00005430| 20 09 09 09 09 09 09 53 | 49 5a 45 4f 46 28 42 6f | ......S|IZEOF(Bo|
|00005440| 78 41 72 72 61 79 29 20 | 2b 20 0d 09 09 09 09 09 |xArray) |+ ......|
|00005450| 32 20 7b 66 6f 72 20 72 | 65 63 6f 72 64 69 6e 67 |2 {for r|ecording|
|00005460| 20 77 68 6f 73 65 20 74 | 75 72 6e 20 69 74 20 69 | whose t|urn it i|
|00005470| 73 7d 3b 0d 45 4e 44 3b | 0d 09 0d 0d 7b 20 54 68 |s};.END;|....{ Th|
|00005480| 69 73 20 61 63 74 75 61 | 6c 6c 79 20 64 6f 65 73 |is actua|lly does|
|00005490| 20 74 68 65 20 66 69 6c | 65 20 6f 75 74 70 75 74 | the fil|e output|
|000054a0| 2e 20 20 4e 6f 74 69 63 | 65 20 74 68 61 74 20 74 |. Notic|e that t|
|000054b0| 68 69 73 20 70 61 72 61 | 6c 6c 65 6c 73 20 0d 74 |his para|llels .t|
|000054c0| 68 65 20 73 74 72 75 63 | 74 75 72 65 20 6f 66 20 |he struc|ture of |
|000054d0| 74 68 65 20 44 6f 52 65 | 61 64 20 6d 65 74 68 6f |the DoRe|ad metho|
|000054e0| 64 20 61 62 6f 76 65 2e | 20 7d 0d 09 0d 50 52 4f |d above.| }...PRO|
|000054f0| 43 45 44 55 52 45 20 54 | 44 6f 74 44 6f 63 75 6d |CEDURE T|DotDocum|
|00005500| 65 6e 74 2e 44 6f 57 72 | 69 74 65 28 61 52 65 66 |ent.DoWr|ite(aRef|
|00005510| 6e 75 6d 3a 20 49 4e 54 | 45 47 45 52 3b 20 09 09 |num: INT|EGER; ..|
|00005520| 09 09 6d 61 6b 69 6e 67 | 43 6f 70 79 3a 20 42 4f |..making|Copy: BO|
|00005530| 4f 4c 45 41 4e 29 3b 20 | 4f 56 45 52 52 49 44 45 |OLEAN); |OVERRIDE|
|00005540| 3b 0d 09 56 41 52 20 63 | 6f 75 6e 74 3a 09 4c 4f |;..VAR c|ount:.LO|
|00005550| 4e 47 49 4e 54 3b 0d 09 | 09 78 3a 09 09 49 4e 54 |NGINT;..|.x:..INT|
|00005560| 45 47 45 52 3b 0d 42 45 | 47 49 4e 0d 09 49 4e 48 |EGER;.BE|GIN..INH|
|00005570| 45 52 49 54 45 44 20 44 | 6f 57 72 69 74 65 28 61 |ERITED D|oWrite(a|
|00005580| 52 65 66 6e 75 6d 2c 20 | 6d 61 6b 69 6e 67 43 6f |Refnum, |makingCo|
|00005590| 70 79 29 3b 0d 09 09 0d | 09 49 46 20 66 50 6c 61 |py);....|.IF fPla|
|000055a0| 79 65 72 31 54 75 72 6e | 20 0d 09 54 48 45 4e 09 |yer1Turn| ..THEN.|
|000055b0| 78 20 3a 3d 20 31 0d 09 | 45 4c 53 45 09 78 20 3a |x := 1..|ELSE.x :|
|000055c0| 3d 20 32 3b 0d 09 09 09 | 0d 09 63 6f 75 6e 74 20 |= 2;....|..count |
|000055d0| 3a 3d 20 32 3b 0d 09 46 | 61 69 6c 4f 53 45 72 72 |:= 2;..F|ailOSErr|
|000055e0| 28 46 53 57 72 69 74 65 | 28 61 52 65 66 6e 75 6d |(FSWrite|(aRefnum|
|000055f0| 2c 20 63 6f 75 6e 74 2c | 20 40 78 29 29 3b 0d 09 |, count,| @x));..|
|00005600| 0d 09 63 6f 75 6e 74 20 | 3a 3d 20 53 49 5a 45 4f |..count |:= SIZEO|
|00005610| 46 28 4c 69 6e 65 41 72 | 72 61 79 29 3b 0d 09 46 |F(LineAr|ray);..F|
|00005620| 61 69 6c 4f 53 45 72 72 | 28 46 53 57 72 69 74 65 |ailOSErr|(FSWrite|
|00005630| 28 61 52 65 66 6e 75 6d | 2c 20 63 6f 75 6e 74 2c |(aRefnum|, count,|
|00005640| 20 40 66 4c 69 6e 65 73 | 29 29 3b 0d 09 09 0d 09 | @fLines|));.....|
|00005650| 63 6f 75 6e 74 20 3a 3d | 20 53 49 5a 45 4f 46 28 |count :=| SIZEOF(|
|00005660| 42 6f 78 41 72 72 61 79 | 29 3b 0d 09 46 61 69 6c |BoxArray|);..Fail|
|00005670| 4f 53 45 72 72 28 46 53 | 57 72 69 74 65 28 61 52 |OSErr(FS|Write(aR|
|00005680| 65 66 6e 75 6d 2c 20 63 | 6f 75 6e 74 2c 20 40 66 |efnum, c|ount, @f|
|00005690| 42 6f 78 65 73 29 29 3b | 0d 45 4e 44 3b 0d 09 0d |Boxes));|.END;...|
|000056a0| 7b 0d 54 48 45 20 45 4e | 44 0d 09 0d 4e 6f 74 69 |{.THE EN|D...Noti|
|000056b0| 63 65 20 74 68 61 74 20 | 74 68 65 72 65 20 77 61 |ce that |there wa|
|000056c0| 73 20 6e 6f 20 63 6f 64 | 65 20 68 65 72 65 20 66 |s no cod|e here f|
|000056d0| 6f 72 20 6d 6f 76 69 6e | 67 2f 72 65 73 69 7a 69 |or movin|g/resizi|
|000056e0| 6e 67 20 0d 77 69 6e 64 | 6f 77 73 2c 20 70 72 69 |ng .wind|ows, pri|
|000056f0| 6e 74 69 6e 67 2c 20 73 | 63 72 6f 6c 6c 69 6e 67 |nting, s|crolling|
|00005700| 2c 20 64 69 73 70 6c 61 | 79 69 6e 67 20 65 72 72 |, displa|ying err|
|00005710| 6f 72 20 6d 65 73 73 61 | 67 65 73 2c 20 0d 68 61 |or messa|ges, .ha|
|00005720| 6e 64 6c 69 6e 67 20 44 | 41 73 2c 20 2e 2e 2e 0d |ndling D|As, ....|
|00005730| 09 0d 41 6c 6c 20 74 68 | 65 73 65 20 66 65 61 74 |..All th|ese feat|
|00005740| 75 72 65 73 20 61 72 65 | 20 69 6d 70 6c 65 6d 65 |ures are| impleme|
|00005750| 6e 74 65 64 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |nted aut|omatical|
|00005760| 6c 79 20 62 79 20 4d 61 | 63 41 70 70 2e 0d 0d 54 |ly by Ma|cApp...T|
|00005770| 6f 20 67 65 74 20 61 6e | 20 69 64 65 61 20 6f 66 |o get an| idea of|
|00005780| 20 74 68 65 20 61 64 76 | 61 6e 63 65 64 20 66 65 | the adv|anced fe|
|00005790| 61 74 75 72 65 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |atures i|mplement|
|000057a0| 65 64 20 62 79 20 0d 4d | 61 63 41 70 70 2c 20 74 |ed by .M|acApp, t|
|000057b0| 72 79 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ry the f|ollowing|
|000057c0| 20 77 68 65 6e 20 79 6f | 75 20 72 75 6e 20 74 68 | when yo|u run th|
|000057d0| 69 73 20 70 72 6f 67 72 | 61 6d 3a 0d 0d 2a 09 53 |is progr|am:..*.S|
|000057e0| 68 72 69 6e 6b 20 74 68 | 65 20 77 69 6e 64 6f 77 |hrink th|e window|
|000057f0| 20 64 6f 77 6e 2c 20 63 | 6c 69 63 6b 20 69 6e 20 | down, c|lick in |
|00005800| 74 68 65 20 67 72 69 64 | 2c 20 61 6e 64 20 64 72 |the grid|, and dr|
|00005810| 61 67 09 6f 75 74 73 69 | 64 65 20 74 68 65 20 77 |ag.outsi|de the w|
|00005820| 69 6e 64 6f 77 0d 2a 09 | 4f 70 65 6e 20 61 20 66 |indow.*.|Open a f|
|00005830| 69 6c 65 20 6f 6e 20 61 | 20 77 72 69 74 65 2d 70 |ile on a| write-p|
|00005840| 72 6f 74 65 63 74 65 64 | 20 64 69 73 6b 2c 20 6d |rotected| disk, m|
|00005850| 61 6b 65 20 61 20 6d 6f | 76 65 2c 20 61 6e 64 20 |ake a mo|ve, and |
|00005860| 09 73 61 76 65 0d 2a 09 | 53 61 6d 65 20 61 73 20 |.save.*.|Same as |
|00005870| 61 62 6f 76 65 2c 20 6f | 6e 6c 79 20 73 65 74 20 |above, o|nly set |
|00005880| 74 68 65 20 66 69 6c 65 | 20 6c 6f 63 6b 20 62 69 |the file| lock bi|
|00005890| 74 20 69 6e 20 74 68 65 | 20 46 69 6e 64 65 72 0d |t in the| Finder.|
|000058a0| 2a 09 54 72 79 20 73 61 | 76 69 6e 67 20 74 6f 20 |*.Try sa|ving to |
|000058b0| 61 20 66 75 6c 6c 20 6f | 72 20 61 6c 6d 6f 73 74 |a full o|r almost|
|000058c0| 20 66 75 6c 6c 20 64 69 | 73 6b 0d 2a 09 4f 70 65 | full di|sk.*.Ope|
|000058d0| 6e 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 74 77 |n the pr|ogram tw|
|000058e0| 69 63 65 20 69 6e 20 53 | 77 69 74 63 68 65 72 3b |ice in S|witcher;|
|000058f0| 20 73 74 61 72 74 20 63 | 68 61 6e 67 69 6e 67 20 | start c|hanging |
|00005900| 74 68 65 20 09 73 61 6d | 65 20 64 6f 63 75 6d 65 |the .sam|e docume|
|00005910| 6e 74 20 61 6e 64 20 74 | 72 79 20 73 61 76 69 6e |nt and t|ry savin|
|00005920| 67 20 6f 72 20 72 65 76 | 65 72 74 69 6e 67 0d 7d |g or rev|erting.}|
|00005930| 0d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005980| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00005990| 00 00 00 37 08 4d 50 57 | 2e 43 6d 64 73 64 02 00 |...7.MPW|.Cmdsd..|
|000059a0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 03 70 00 c0 |..TEXTMP|S ...p..|
|000059b0| 0c 55 44 6f 74 73 2e 69 | 6e 63 31 2e 70 69 02 00 |.UDots.i|nc1.pi..|
|000059c0| 00 00 54 45 58 54 4d 41 | 43 41 01 00 00 34 00 4b |..TEXTMA|CA...4.K|
|000059d0| 00 00 54 45 58 54 4d 41 | 43 41 01 00 00 34 00 4b |..TEXTMA|CA...4.K|
|000059e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059f0| 00 00 9b a9 5f 27 00 00 | 58 b1 00 00 01 7e 00 00 |...._'..|X....~..|
|00005a00| 00 00 00 00 0e 00 00 00 | 00 37 08 4d 50 57 2e 48 |........|.7.MPW.H|
|00005a10| 65 6c 70 6c 02 00 00 00 | 54 45 58 54 4d 50 53 20 |elpl....|TEXTMPS |
|00005a20| 01 00 03 70 01 20 00 37 | 00 00 1e 1a 00 00 00 00 |...p. .7|........|
|00005a30| 70 68 00 00 72 00 00 00 | 00 00 01 7e 00 00 02 00 |ph..r...|...~....|
|00005a40| 9b 83 8a b0 9b 9c 37 96 | 00 00 00 00 4a e1 f5 5e |......7.|....J..^|
|00005a50| 00 00 e2 fc 00 00 00 00 | 00 00 00 00 00 00 19 2b |........|.......+|
|00005a60| 00 39 00 00 00 00 00 00 | 00 00 17 e8 00 01 00 00 |.9......|........|
|00005a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 0e 00 00 00 |........|........|
|00005a80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 7d 7d 7d |...H..Mo|naco.}}}|
|00005a90| 7d 7d 7d 7d 7d 7d 7d 7d | 7d 7d 7d 7d 7d 7d 7d 7d |}}}}}}}}|}}}}}}}}|
|00005aa0| 7d 7d 7d 7d 7d 7d 00 06 | 00 04 00 29 00 03 01 53 |}}}}}}..|...)...S|
|00005ab0| 01 fd 00 4d 00 03 01 55 | 01 ff 9b bf ad 5e 00 00 |...M...U|.....^..|
|00005ac0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00005ad0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 01 15 24 |...L...L|...2...$|
|00005ae0| 04 6a 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.j.....2|..MPSR..|
|00005af0| 00 0a 03 ed ff ff 00 00 | 00 00 00 02 38 d0 00 00 |........|....8...|
+--------+-------------------------+-------------------------+--------+--------+